
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
app-context-express
Advanced tools
express initializer for app-context
The express initailizer takes a small amount of configuration and will load certain files
in succession. The express app will be attached to APP.express and the HTTP server will
be attached to APP.httpServer.
Configuration is very simple. The config object only takes a port. Look at the example
below to see how it's used.
The express initializer will first create an express app and then pass it into a few files
found in the configured root. These files are initialize.js, middleware.js, and router.js.
All files are optional and can return a promise if they need to be asynchronous.
$ npm install --save app-context-express
var AppContext = require('app-context');
var express = require('app-context-express');
module.exports = AppContext.createContext({
configure: function() {
this.use(
AppContext.RunLevel.Running,
// create an express instance using port 3000 and the files found in app/server
express({
root: 'app/server',
config: {
port: 3000
}
})
);
// you can optionally use app-context-express through app-context-initialize
var initialize = require('app-context-initialize');
this.use(
AppContext.RunLevel.Running,
initialize({
express: {
root: 'app/server',
config: '$server'
}
})
);
}
});
// This file is rarely used, but allows you to do something here that
// you want complete before the middleware is run. Maybe something async.
var request = require('request-promise');
module.exports = function(app) {
return request('http://myserver.com/authCredentials?key=' + APP.config.credKey).then(function(creds) {
app.set('creds') = creds;
});
};
var cors = require('cors');
var morgan = require('morgan');
var bodyParser = require('body-parser');
module.exports = function(app) {
app.use(morgan('dev'));
app.use(cors({origin: true}));
app.use(bodyParser.json());
};
module.exports = function(app) {
app.get('/', require('./routes/index'));
};
FAQs
Express initializer for app-context
The npm package app-context-express receives a total of 14 weekly downloads. As such, app-context-express popularity was classified as not popular.
We found that app-context-express 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
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.