Files
lucko-paste/README.md

70 lines
2.2 KiB
Markdown
Raw Normal View History

2022-01-08 19:10:27 +00:00
<p align="center">
<img src=".github/banner.svg">
</p>
2021-03-26 22:00:12 +00:00
2021-10-27 23:37:42 +01:00
**paste is a simple web app for writing & sharing code.** It's my own take on conventional pastebin sites like _pastebin.com_ or _hastebin_.
2021-03-26 22:00:12 +00:00
2025-02-23 15:18:45 +00:00
Anyone can use paste! The official/public instance can be accessed using the endpoints listed below, but you can also [host your own](#self-hosting) if you like!
2022-01-18 21:06:12 +00:00
##### 1) In a Web Browser
Just go to https://pastes.dev!
##### 2) From the Command Line
You can submit content most easily using [curl](https://curl.se/docs/manpage.html).
2022-01-18 21:06:12 +00:00
```shell
# Upload the contents of a file
> curl -T example.txt https://api.pastes.dev/post
# Upload the contents of a file and specify the language
> curl -T example.yml -H "Content-Type: text/yaml" https://api.pastes.dev/post
# Pipe in some output from any command
> echo "Hello world" | curl -T - https://api.pastes.dev/post
2022-01-18 21:06:12 +00:00
```
<details>
<summary>If you don't want to do so much typing, you can create a shorter <b>alias</b>.</summary>
```bash
# Add this to the end of `~/.bashrc` and run 'source ~/.bashrc'
paste() {
curl -T $1 https://api.pastes.dev/post
}
```
then...
```shell
# Upload the contents of a file
> paste example.txt
# Pipe in some output from any command
> echo "Hello!" | paste -
```
</details>
2025-08-27 21:55:46 +01:00
##### 3) From Code / Scripts
Please see the [API Documentation](/API.md). :)
2022-01-18 21:06:12 +00:00
___
### About
2021-10-27 23:37:42 +01:00
The frontend _(this repository)_ is written using the React framework. The backend data storage is handled by a separate web service called [bytebin](https://github.com/lucko/bytebin).
2021-03-27 17:01:20 +00:00
2022-01-08 19:10:27 +00:00
The user-interface is based on the [Monaco Editor](https://microsoft.github.io/monaco-editor/), the engine behind the popular Visual Studio Code text editor. It's quite simple; it supports syntax highlighting, automatic indentation, many supported languages, themes, zooming in/out, linking to specific lines or sections, and more!
2021-03-27 17:01:20 +00:00
2022-01-18 21:06:12 +00:00
___
2025-02-23 15:18:45 +00:00
### Self-hosting
2021-10-27 23:37:42 +01:00
2025-02-23 15:18:45 +00:00
The easiest way to self-host is using Docker (& Docker Compose). You can run the following commands to get started:
2021-03-27 17:01:20 +00:00
```bash
git clone https://github.com/lucko/paste
2022-01-08 19:10:27 +00:00
cd paste
2021-10-27 23:37:42 +01:00
docker compose up -d
```
You should then (hopefully!) be able to access the application at `http://localhost:8080/`.