@tsq/api-factory

1.0.10 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @tsq/api-factory

Weekly Downloads

0

Version

1.0.10

License

MIT

Unpacked Size

4.15 kB

Total Files

4

Last publish

Collaborators

  • tsq-me