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.
f8a0ebb004 | 5 years ago | |
---|---|---|
config | 5 years ago | |
controllers | 6 years ago | |
models | 6 years ago | |
public | 5 years ago | |
views | 5 years ago | |
.editorconfig | 8 years ago | |
.eslintrc.json | 5 years ago | |
.gitattributes | 9 years ago | |
.gitignore | 9 years ago | |
LICENSE.md | 5 years ago | |
README.md | 6 years ago | |
app.js | 5 years ago | |
db.js | 5 years ago | |
docker-compose.yml | 9 years ago | |
package-lock.json | 5 years ago | |
package.json | 5 years ago | |
router.js | 5 years ago | |
server.js | 5 years ago |
README.md
paste
Simple Node.js pastebin built with Koa, MongoDB, Jade, Bootstrap and Prism.js.
Try it out at paste.fyi
Features
- Clean code thanks to ES7 async/await and Koa
- 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.js
- Automatic and configurable paste expiry
- Runs fully containerized with Docker and Vagrant
- Simple and responsive UI built with Bootstrap
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
- Clone this repo:
git clone https://github.com/JoeBiellik/paste.git && cd paste
- Start the virtual machine and connect:
vagrant up
vagrant ssh
- Install dependencies:
npm install
- Start MongoDB:
docker-compose up -d db
- Start app and watch for changes:
npm run watch
Deployment
-
Configure
config/docker.json
with any custom settings -
Start the production database and Node.js server:
docker-compose up