bookshelf-rest-api
v2.0.3
Published
Quickly build a rest API with little to no thought if you're using Bookshelf.js for your models
Downloads
7
Maintainers
Readme
bookshelf-rest-api
Quickly connect Bookshelf models tor
npm install bookshelf-rest-api --save
yarn add bookshelf-rest-api
See /example as for how to set it up
-- examples/api.js shows the setup -- databases/postgres.js is how we set up our postgres models, you should do something similar and then your Model should extend that Bookshelf.Model.
QUICK START
Copy examples/api.js to ./api.js of your project. Add models.
// In app.js
var app = express();
// somewhere after the above line
require('./api')(app);
That's it. Now you have a CRUD powered app with a full life cycle for its model.