Simple Node.js pastebin
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.
 
 
 
Go to file
Joe Biellik 341bf63422 Improve linting 5 years ago
config Add more languages 5 years ago
controllers Improve caching and argument handing 5 years ago
models
public Prefill select 5 years ago
views Update libraries and refactor UI 5 years ago
.editorconfig
.eslintrc.json Improve linting 5 years ago
.gitattributes
.gitignore
LICENSE.md Update year 5 years ago
README.md Update instructions 5 years ago
app.js Improve caching 5 years ago
db.js Simplify DB configuration 5 years ago
docker-compose.yml Update configuration 5 years ago
package-lock.json Update dependencies 5 years ago
package.json Update dependencies 5 years ago
router.js Improve caching 5 years ago
server.js Add host address configuration 5 years ago

README.md

paste

License Release Version Dependencies

Simple Node.js pastebin built with Koa, MongoDB, Jade, 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 URLs via shortid, e.g. NyQO9puMe
  • Textarea grows to fit content via autosize.js
  • Simple and responsive UI built with Bootstrap
  • Clean code thanks to ES7 async/await and Koa
  • Runs fully containerized with Docker

Usage

# Simple paste
$ echo 'Hello World' | curl -F 'paste=<-' http://paste.fyi
http://paste.fyi/N15FNVqfg

# wget or any other tool is fine too:
$ wget --post-data 'paste=Hello from wget' -qO- http://paste.fyi

# Either form or multipart data is accepted:
$ curl -d 'paste=Sent as multipart' http://paste.fyi

# Specify the syntax to highlight:
$ git diff README.md | curl -F 'paste=<-' -F 'highlight=diff' http://paste.fyi

Development

  1. Clone this repo:
git clone https://github.com/JoeBiellik/paste.git && cd paste
  1. Install dependencies:
docker-compose run -e NODE_ENV=dev --rm --no-deps app npm install
  1. Start app and watch for changes:
docker-compose run -e NODE_ENV=dev --rm --service-ports app npm run watch

Deployment

  1. Configure config/docker.json with any custom settings

  2. Start the production database and Node.js server:

docker-compose up