# Coffeepaste Coffeepaste is a pastebin-like service intended to be used from the command line. ## Building Build with `cargo build` (or `cargo build --release` for a release build). ## Config The config file `config.toml` contains config options like data path, page URL, max file size, etc. It's compiled into the binary, so any changes requires a recompile. ## Usage The basic usage is to do `curl --upload-file ` to upload a file, or `curl --upload-file - ` to upload from stdin. The server will respond with a URL to your content. The URL's extension doesn't change the content of the file, but might change the way it's presented. ## HTTP endpoints ### `GET /`, `GET /index.html` Get the main page which provides usage information. ### `GET /` Get the raw content of the file with the given ID. ### `GET /.` View the contents of the file with the given ID, but displayed in a way determined by the extension. * Any extension associated with an image, video or audio file is sent unmodified, but with the appropriate Content-Type header. * Other extensions are a bit more complex: * If the client doing the request doesn't advertise HTML support, the client is sent the content unmodified. * Otherwise, the client is sent an HTML page which adds syntax highlighting and other features, where the syntax highlighting is determined by the extension (or, if the extension is `.auto`, the syntax highlighting guesses the file type based on content). ### `PUT /` Upload a file to the server. The path is ignored (a random ID is generated instead), but if the path has a file extension, the returned URL will have the same file extension.