Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
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 87 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.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.