1.0.0 • Published 7 years ago
reaktor v1.0.0
Reaktor
More docs coming soon...
TODO
- Upgrade to Webpack 2.0 (https://webpack.js.org/guides/migrating/)
- Add Token expiration time to the config
- Separate builds (https://medium.com/@ryanflorence/welcome-to-future-of-web-application-delivery-9750b7564d9f#.gvl3ti63e)
- Add a rate limiter (https://github.com/nfriedly/express-rate-limit)
Create an API endpoint
Get all items
apiUtils.createApi({
type: 'GET',
url: 'items/all',
rawModel, // the raw datamodel
databaseModel, // the mongoose data model
options: {
queryType: apiUtils.QUERY_ALL, // the query type
queryParams: ['email', 'height'], // it can only be filtered by the fields here
limit: 0, // a numeric value
sort: '', // a field to sort by, string
authenticate: true, // set authentication for this API endpoint
}
});
Get a single item
apiUtils.createApi({
type: 'GET',
url: 'items/single',
rawModel, // the raw datamodel
databaseModel, // the mongoose data model
options: {
queryType: apiUtils.QUERY_SINGLE, // the query type
queryParams: ['email'], // it can only be filtered by the fields here
fields: [] /// only the fields listed here will be in the response
}
});