0.0.1 • Published 11 years ago
anybin v0.0.1
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
- Automatically saves document changes in the database
- Automatically makes a new version each time user saves a bin
- Import from another page on the web with
?importquery parameter. Example: http://anybin.herokuapp.com/?import=https://raw.githubusercontent.com/mohsen1/anybin/master/README.md - Client side cache of recently made versions
Running locally
git clone git@github.com:mohsen1/anybin.git
cd anybin
npm install
npm run devServer command line options
configfor selecting the configuration fileviewsfor selecting the folder to look forindex.ejsfilepublicfor selecting public content folderdbMongoDB URL, it will override database URLs inconfig.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
| Operation | Path | Description |
|---|---|---|
| GET | / | Load homepage |
| GET | /?import=url | Load homepage and import from url |
| GET | /:id | Load a bin |
| GET | /:id/:version | Load a bin at a version |
API
| Operation | Path | Description |
|---|---|---|
| POST | /api/ | Make a new Bin |
| POST | /api?import=url | Make a new Bin form url |
| GET | /api/:id | Get latest version of a bin |
| PUT | /api/:id | Update latest version of a bin |
| POST | /api/:id | Add a new version to a bin |
| GET | /api/:/id/:version | Get a specific version of a bin |
License
MIT
0.0.1
11 years ago