UNPKG

apialize

Version:

Turn a database model into a production ready REST(ish) CRUD API in a few lines.

20 lines (16 loc) 377 B
const { createOperationHandler, OPERATION_TYPES, } = require('./operationHandler'); function patch(model, options = {}, modelOptions = {}) { const { router, handlers } = createOperationHandler( model, OPERATION_TYPES.PATCH, options, modelOptions ); router.patch('/:id', handlers); router.apialize = {}; return router; } module.exports = patch;