ABOUT
A simple pastebin powered by Rocket.
Simple API. CLI. Web form. Renders Markdown. Highlights code.
API USAGE
POST https://paste.yexp.dev/
Send the raw data along. Will respond with a link to the paste.
Requires authorization via API key using the X-Api-Key header.
If the response code is 201 (CREATED), then the entire paste was
uploaded. If the response is 206 (PARTIAL), then the paste exceeded
the server's maximum upload size, and only part of the paste was
uploaded. If the response code is anything else, an error has
occurred. Pasting is heavily rate-limited.
GET https://paste.yexp.dev/<id>
Retrieve the paste with the given <id> as plain text.
GET https://paste.yexp.dev/<id>.<ext>
Retrieve the paste with the given <id>.
If <ext> is "md", "mdown", or "markdown", the paste is rendered as
markdown into HTML. If <ext> is a known code file extension, the paste
is syntax highlighted and returned as HTML. If <ext> is a known format
extension, the paste is returned with the format's corresponding
Content-Type. Otherwise, the paste is returned as unmodified text.
DELETE https://paste.yexp.dev/<id>
Delete the paste with the given <id>. Requires authorization via API
key using the X-Api-Key header.
EXAMPLES
Paste a file named 'file.txt' using cURL:
curl --data-binary @file.txt https://paste.yexp.dev/
Paste from stdin using cURL:
echo "Hello, world." | curl --data-binary @- https://paste.yexp.dev/
Delete an existing paste using cURL:
curl -X DELETE https://paste.yexp.dev/<id>
A shell function that can be added to `.bashrc` or `.bash_profle` for
quick pasting from the command line. The command takes a filename or reads
from stdin if none was supplied and outputs the URL of the paste to
stdout: `paste file.txt` or `echo "hi" | paste`.
function paste() {
local file=${1:-/dev/stdin}
curl --data-binary @${file} https://paste.yexp.dev
}