bookshelf-rest-api

2.0.3 • Public • Published

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.

Package Sidebar

Install

npm i bookshelf-rest-api

Weekly Downloads

9

Version

2.0.3

License

GPL-3.0-or-later

Unpacked Size

63.3 kB

Total Files

26

Last publish

Collaborators

  • brightleydeveloped