Thank you for using PasteLite, you can customize this homepage by editing:
static/index.htmlin the project's root directory
| Route | Description | Query Parameters | Return value |
|---|---|---|---|
POST/paste |
Creates a new paste with type determined by content-type *URL only included if PASTE_URL_PREFIX is set |
|
{ |
GET
/:name
/:name.html
|
Display a paste in html with syntax highlighting |
|
HTML site |
GET
/:name/raw
/:name.txt
|
Returns the paste content as text/plain |
None | text/plain content |
GET
/:name/json
/:name.json
|
Returns the paste content as JSON, or 404 if unavailable (not JSON) | None | application/json content |
GET
/:name/meta
/:name.meta.json
|
Returns metadata about paste in JSON | None |
{
|
DELETE/:name/deleteToken |
Deletes the paste if delete token matches | None | 204 on success |
All the GET routes also return the following headers:
Configuration is done using environmental variables, either you can set these using export or ENV_VAR=value node ..., or you can create a .env file in the project root with each line being a variable
Here is all the possible configurations:
| Name | Description | Default |
|---|---|---|
| WEB_PORT | The port to run the server on | 8080 |
| PASTE_DEFAULT_EXPIRES | The default time in seconds that a paste will expire, unless overwritten | 86400 (1 day) |
| PASTE_MAX_EXPIRES | If set, clamps the expires time to this value | not set |
| PASTE_ALLOWED_MIMES | A comma-separated list of mime types to allow, in addition to text/* | application/json |
| PASTE_ID_ALPHABET | The characters chosen for a paste's unique id | 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz |
| PASTE_ID_LENGTH | How long a paste's id should be | 12 |
| PASTE_URL_PREFIX | If set, a 'url' field added to creation with this | not set |
| BODY_LIMIT | Fastify's max request body size | 1048576 (1MiB) |
| PASTE_CLEANUP_INTERVAL | How often to check for pastes to be cleaned up in seconds. It is not the actual paste expiration. | 3600 |