2.0.3 • Published 4 years ago

bookshelf-rest-api v2.0.3

Weekly downloads
4
License
GPL-3.0-or-later
Repository
github
Last release
4 years ago

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.