0.0.0 • Published 10 years ago

halfbin v0.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 years ago

AnyBin

A boilerplate bin website for saving text in a database and access it with a short URL. Very similar to PasteBin or JSBin. This is mostly back-end implementation of the website. Front-end is very simple.

Try a version of the app running here

Work in progress

Features

Running locally

git clone git@github.com:mohsen1/anybin.git
cd anybin
npm install
npm run dev

Server command line options

  • config for selecting the configuration file
  • views for selecting the folder to look for index.ejs file
  • public for selecting public content folder
  • db MongoDB URL, it will override database URLs in config.js
Example
$ node app/server.js \
  --config='/path/to/my/config.js' \
  --views='/path/to/my/views-folder/' \
  --public='/path/to/my/public-folder' \
  --db='mongodb://user:pass@me.dbhost.com:9999/my-db'

Routes

Website

OperationPathDescription
GET/Load homepage
GET/?import=urlLoad homepage and import from url
GET/:idLoad a bin
GET/:id/:versionLoad a bin at a version

API

OperationPathDescription
POST/api/Make a new Bin
POST/api?import=urlMake a new Bin form url
GET/api/:idGet latest version of a bin
PUT/api/:idUpdate latest version of a bin
POST/api/:idAdd a new version to a bin
GET/api/:/id/:versionGet a specific version of a bin

License

MIT