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 2b859ea587 Cleanup 10 years ago
config Update Docker configuration 11 years ago
controllers Improve linting and cleanup 10 years ago
models Add paste expiry 11 years ago
public Newer jQuery syntax 10 years ago
views Update Bootstrap 10 years ago
.editorconfig Cleanup 10 years ago
.eslintrc.json Cleanup 10 years ago
.gitattributes Initial commit 11 years ago
.gitignore Update Docker configuration 11 years ago
LICENSE.md 2016 10 years ago
README.md Remove Node version badge 10 years ago
Vagrantfile Initial commit 11 years ago
app.js Improve linting and cleanup 10 years ago
db.js Improve linting and cleanup 10 years ago
docker-compose.yml Don't use watch by default 10 years ago
package.json Cleanup 10 years ago
router.js Add paste expiry 11 years ago
server.js Initial commit 11 years ago

README.md

paste

License Release Version Dependencies

Simple Node.js pastebin built with Koa, MongoDB, Jade, Bootstrap 4 and Prism.js.

Try it out at paste.fyi

Features

  • Clean code thanks to ES7 async/await, Koa and Babel
  • Full syntax highlighting via Prism.js
  • CTRL+Enter hotkey for quick paste submission
  • Short URLs via shortid, e.g. NyQO9puMe
  • Full support for CLI requests with curl etc
  • Textarea grows to fit content via autosize
  • Automatic and configurable paste expiry
  • Runs fully containerized with Docker and Vagrant
  • Simple and responsive UI built with Bootstrap 4

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. Start the virtual machine and connect:
vagrant up
vagrant ssh
  1. Install dependencies:
npm install
  1. Start MongoDB:
docker-compose up db -d
  1. Start app and watch for changes:
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