FORK NOTICE — This is a fork.
This fork adds a prominent "Private notes" feature (client-side encryption; server stores only encrypted blobs) and is designed to be deployed on Cloudflare Workers. See the "Private notes (added in this fork)" and "Self-hosting" sections for details and deployment instructions.
paste is a simple web app for writing & sharing code. It's my own take on conventional pastebin sites like pastebin.com or hastebin.
Anyone can use paste! The official/public instance can be accessed using the endpoints listed below, but you can also host your own if you like!
Note: this repository is a fork that adds a "private notes" feature (client-side encrypted/personal notes) and is intended to be deployed on Cloudflare Workers. The private notes feature encrypts content in the browser before upload so that only someone with the password can decrypt the note.
Just go to https://pastes.dev!
You can submit content most easily using curl.
# 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/postIf you don't want to do so much typing, you can create a shorter alias.
# Add this to the end of `~/.bashrc` and run 'source ~/.bashrc'
paste() {
curl -T $1 https://api.pastes.dev/post
}then...
# Upload the contents of a file
> paste example.txt
# Pipe in some output from any command
> echo "Hello!" | paste -Please see the API Documentation. :)
The frontend (this repository) is written using the React framework. The backend data storage is handled by a separate web service called bytebin.
The user-interface is based on the 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!
Deploy on Cloudflare Workers using Wrangler. This repo builds a static frontend with Vite and serves it from the Worker alongside a minimal KV-backed API.
- Install Wrangler:
npm i -g wrangler - Create a KV namespace:
wrangler kv:namespace create NOTESand copy the IDs intowrangler.toml. - Build the frontend:
yarn buildornpm run build(producesdist). - Develop locally:
wrangler dev(serves assets and the API at/api/). - Deploy:
wrangler deploy.
Configuration:
- The frontend uses
/api/as the default base URL. Override withVITE_BYTEBIN_URLif needed. - API endpoints:
- Upload:
POST /api/post(gzip body,Content-Type: text/<language>) - Read:
GET /api/{key}(returns raw content with the savedContent-Type)
- Upload:
Private notes (added in this fork):
- Use the
[save🔒]button to encrypt content client-side (AES‑GCM + PBKDF2) and upload. The server only stores the encrypted payload and never receives the decryption password. - When creating a private note you may optionally mark it as non-indexed; it will still live in KV but remains encrypted and unlisted by the public index.
- Opening an encrypted paste prompts for the password to decrypt in the browser. If the correct password is not provided, the content remains unreadable.
Deployment note for this fork:
- This fork is designed to be deployed on Cloudflare Workers (the repository already includes
wrangler.tomland a minimal Worker-backed API). If you want to deploy the forked app to Workers, follow the steps below.