
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
service-scaff
Advanced tools
Express bundled with Passport authentication, Redis sessions, morgan logs
var resources = {
redis: redisConfigOrClient,
mysql: mysqlConfigOrClient,
mongo: mongoConfigOrClient,
sphinxql: sphinxqlConfigOrClient,
rabbit: rabbitConfigOrClient
}
var server = require('service-scaff');
server
.resources(config)
.web()
.register('my-service', '/', ['my-service-alias'])
.startOnResourcesConnected()
// OLD
var server = require('express-middleware-bundle');
//------------------------------------
// set redis config for sessions, remember me authentication strategy
//------------------------------------
server.redis({
//redis config
})
//------------------------------------
// set mysql config for local and api authentication stategies
//------------------------------------
server.mysql({
// mysql config
})
//------------------------------------
// add auth (remember me, apikey, local) and session middleware
//------------------------------------
server.web()
//------------------------------------
// mount static assest to path
//------------------------------------
server.addStaticDir('./css', 'static');
server.addStaticDir('./js', 'static');
//------------------------------------
// mount static assest to root
//------------------------------------
server.addStaticDir('./root');
//------------------------------------
// use jade templates from a dir
//------------------------------------
server.addJade('./jade');
//------------------------------------
// use built in login and logout handlers
//------------------------------------
server.post('/login', server.login.bind(server));
server.get('/logout', server.logout.bind(server));
//------------------------------------
// add routes that dont need authentication
//------------------------------------
server.get(
'/nonauth-route',
function(req,res,next){
res.end('you are NOT authenticated')
}
);
//------------------------------------
// every route after this requires authentication
//------------------------------------
server.use(server.authenticated.bind(server));
server.get(
'/auth-route',
function(req,res,next){
res.end('you are authenticated')
}
)
//------------------------------------
// check user roles
//------------------------------------
server.get(
'/needARole',
server.checkRoles.bind(server,['roleA','roleB'])
function(req,res,next){
res.end('you have either roleA or roleB')
}
)
//------------------------------------
// check user roles for conditional middleware
//------------------------------------
server.get(
'/needARoleForSomeMiddleware',
getSomeData,
server.checkRolesWrapper.bind(server,['roleA'], conditionalMiddlewareToModifyData),
returnData
)
server.start(port, function(){
// server has started
})
Make a fresh server object:
var server2 = server.ExpressMiddlewareBundle();
FAQs
resource scaff for services
We found that service-scaff demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.