sgs-routing

1.0.0 • Public • Published

sgs-routehandler

Express middleware to handle an api route by following the paths et taking action at the last route part regarding the CRUD spec.

Mongoose must be loaded in global scope beforehand.

The next routes are supported (not exhaustive):

  • GET /api/
  • POST /api/
  • GET /api//:id
  • GET /api//
  • PUT /api//:id
  • DELETE /api//:id
  • GET /api//:id/
  • POST /api//:id/
  • POST /api//:id/
  • GET /api//:id//:embeddedId
  • PUT /api//:id//:embeddedId
  • DELETE /api//:id//:embeddedId

Dependents (0)

Package Sidebar

Install

npm i sgs-routing

Weekly Downloads

1

Version

1.0.0

License

none

Last publish

Collaborators

  • sagacify