Yet Another Pastebin

This is a pastebin deployed on Cloudflare workers, depending on Cloudflare KV storage.

How to use: paste any text here, and you can share it with a super short URL.

Philosophy: effortless deployment, friendly CLI usage, rich functionality.

CLI Usage

Upload a paste

$ echo "make Cloudflare great again" | curl -Fc=@- https://pb.i207m.top/
{
  "url": "https://pb.i207m.top/qotL",
  "admin": "https://pb.i207m.top/qotL_yNm3PTBA3+X1jjhdClJ6zyVMkfA=",
  "isPrivate": false
}%  

Fetch the paste

$ curl https://pb.i207m.top/qotL
make Cloudflare great again 

Delete the paste

$ curl -X DELETE https://pb.i207m.top/qotL_yNm3PTBA3+X1jjhdClJ6zyVMkfA=
the paste will be deleted in seconds

$ curl https://pb.i207m.top/qotL
not found% 

Update the paste

$ echo "make Cloudflare great again and again" | curl -Fc=@- https://pb.i207m.top/qotL_yNm3PTBA3+X1jjhdClJ6zyVMkfA=
{
  "url": "https://pb.i207m.top/qotL",
  "admin": "https://pb.i207m.top/qotL_yNm3PTBA3+X1jjhdClJ6zyVMkfA=",
  "isPrivate": false
}% 

Advanced Usage

Fetch the paste with syntax highlighting

$ curl https://pb.i207m.top/48wp?lang=makefile

Url redirect

$ curl -fc=https://github.com/SharzyL/pastebin-worker/ https://pb.i207m.top/
$ curl -L https://pb.i207m.top/u/i-p-

Let the paste expire in 120 seconds

$ echo "make Cloudflare great again" | curl -Fc=@- -Fe=120 https://pb.i207m.top/
{
  "url": "https://pb.i207m.top/qotL",
  "admin": "https://pb.i207m.top/qotL_yNm3PTBA3+X1jjhdClJ6zyVMkfA=",
  "isPrivate": false,
  "expire": "120"
}%
$ sleep 120; curl https://pb.i207m.top/qotL
not found%

Create a paste with longer path name for better privacy

$ echo "make Cloudflare great again" | curl -Fc=@- -Fp=true https://pb.i207m.top/
{
  "url": "https://pb.i207m.top/HaK8PuBqrLi5woH0cbTBi7uN",
  "admin": "https://pb.i207m.top/HaK8PuBqrLi5woH0cbTBi7uN_TWcWYDRL4SscGQ9P9n7tO7Vu6HU=",
  "isPrivate": true,
}% 

About

API design is inspired by fars.ee

Source code and error report: SharzyL/pastebin-worker