@tsq/api-factory
v1.0.10
Published
a tool for mongo CRUD
Downloads
19
Readme
api-factory
a api tool for Node.js
Install
npm i @tsq/api-factory
Usage
const apiFactory = require('@tsq/api-factory');
router
.route('/')
.get(apiFactory.getAll(User))
.post(apiFactory.createOne(User));
router
.route('/:id')
.get(checkId(User), apiFactory.getOne(User))
.put(checkId(User), apiFactory.updateOne(User))
.delete(checkId(User), apiFactory.deleteOne(User));
Dependencies
- tsq-a/check-id
- tsq-a/express-response