0.1.2 • Published 10 years ago
endpoints-model v0.1.2
endpoints-model
model layer for the endpoints framework
a quick and dirty extraction of some tools i use all the time for building rest apis.
Example
const Model = require('endpoints-model');
const Knex = require('knex')({
client: "pg",
connection: {
host: "localhost",
user: "user",
database: "db",
password: "pass"
},
});
const BaseModel = Model({
Bookshelf: require('bookshelf')(Knex),
Validator: require('checkit'),
linkPrefix: '/api/v1' // when a model is serialized, the automatically generated `links` key may need a prefix to produce the correct endpoint URL.
});