
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
cf-crud-service-api-builder
Advanced tools
Build an HTTP API for a crud-service.
npm install --save cf-crud-service-api-builder
const crudServiceApiBuilder = require('cf-crud-service-api-builder')
const router = require('express')()
const logger = require('bunyan').createLogger()
const service = require('./service')
const middleware = require('./auth-check-middleware')
crudServiceApiBuilder(service, '/widgets', router, logger, middleware)
When using the api builder, you can hook into certain actions to manipulate the request data before it is sent to the database or the response data before it is sent to the requester.
const api = crudServiceApiBuilder(service, '/article', router, logger, middleware)
api.hook('create:request', function (data, cb) {
// do whatever you like with the data
cb(null, data)
})
Supported hooks are:
create:request
create:response
read:response
update:request
update:response
partialUpdate:request
partialUpdate:response
When using the api builder, you can listen for certain events so that you can add hooks to perform your own actions after a request has been succesful. e.g
const api = crudServiceApiBuilder(service, '/article', router, logger, middleware)
api.on('create', function (req, newArticle) {
// do whatever you like with the req and article object
})
Supported events are:
create
update
partialUpdate
delete
Built by developers at Clock.
Licensed under the ISC
FAQs
Build an HTTP API for a crud-service
The npm package cf-crud-service-api-builder receives a total of 18 weekly downloads. As such, cf-crud-service-api-builder popularity was classified as not popular.
We found that cf-crud-service-api-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.