mirror of https://github.com/JoeBiellik/paste
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1f96c5d55f
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <support@github.com> |
4 years ago | |
---|---|---|
config | ||
controllers | 4 years ago | |
models | 4 years ago | |
public | 4 years ago | |
views | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.pug-lintrc.json | ||
.xo-config.json | ||
LICENSE.md | ||
README.md | ||
app.js | 4 years ago | |
db.js | ||
docker-compose.yml | 4 years ago | |
package-lock.json | 4 years ago | |
package.json | 4 years ago | |
prism-langs.js | 4 years ago | |
router.js | ||
server.js |
README.md
paste
Simple Node.js pastebin built with Koa, MongoDB, Pug, Bootstrap and Prism.js.
Try it out at paste.fyi
Features
- Full syntax highlighting via Prism.js
- Automatic and configurable paste expiry
- Full support for CLI requests with curl, Wget etc
- CTRL+Enter hotkey for quick paste submission
- Short and readable URLs via nanoid, e.g.
/qNGDwRyx
- Textarea grows to fit content via autosize.js
- Runs fully containerized with Docker
CLI Usage
# Simple paste
$ echo 'Hello World' | curl -F 'paste=<-' paste.fyi
http://paste.fyi/qNGDwRyx
# Either form, multipart or raw text data is accepted
$ curl -F 'paste=Sent as form data' https://paste.fyi
$ curl -d 'paste=Sent as multipart data' https://paste.fyi
$ curl -H "Content-Type: text/plain" -d 'Sent as raw text' https://paste.fyi
# Wget or any other tool is fine too
$ wget --post-data 'paste=Hello from Wget' -qO- https://paste.fyi
# Upload a file
$ curl -F 'paste=@path/to/file.txt' https://paste.fyi
# Specify the expiry time in seconds
$ curl -F 'paste=2 minutes' -F 'expire=120' https://paste.fyi
$ curl -F 'paste=2 minutes' https://paste.fyi/?expire=120
# Specify the syntax to highlight
$ git diff README.md | curl -F 'paste=<-' https://paste.fyi/?diff
$ curl -F 'paste=@path/to/file.diff' -F 'highlight=diff' https://paste.fyi
# Redirect to content
$ curl -F 'paste=My paste' https://paste.fyi/?redirect
My paste
# Combined options
$ curl -F 'paste=My paste' -F 'expire=60' -F 'highlight=shell' https://paste.fyi
$ curl -F 'paste=My paste' 'https://paste.fyi/?expire=120&shell'
Development
- Clone this repo:
git clone https://github.com/JoeBiellik/paste.git && cd paste
- Install dependencies:
docker-compose run -e NODE_ENV= --rm --no-deps app npm install
- Start the app and watch for changes:
docker-compose run -e NODE_ENV= --rm --service-ports app npm run watch
Deployment
-
Follow the first two development steps.
-
Configure
config/docker.json
with any custom setting overrides -
Configure
docker-compose.yml
with Docker options and ports to use -
Start the production database and Node.js server:
docker-compose up