
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
@financial-times/dotcom-middleware-app-context
Advanced tools
This package provides an [Express] compatible middleware which appends an instance of [app context] to each request and configures it with details automatically inferred from the running application.
This package provides an Express compatible middleware which appends an instance of app context to each request and configures it with details automatically inferred from the running application.
This package is compatible with Node 12+ and is distributed on npm.
npm install --save @financial-times/dotcom-middleware-app-context
After installing the package create a new instance of the middleware and register it with your application. The middleware can be configured with several options:
const express = require('express')
const app = express()
+const appContext = require('@financial-times/dotcom-middleware-app-context')
+app.use(appContext.init())
Once registered an appContext
property will be added to the response locals:
app.get('/', (request, response) => {
const appContextData = response.locals.appContext.getAll()
})
See the app context package documentation for more information.
The middleware accepts the following parameters:
appContext
An app context data object, see the app context schema for more information. This can be used to append extra properties or override any of the properties automatically inferred from the running application.
FAQs
This package provides an [Express] compatible middleware which appends an instance of [app context] to each request and configures it with details automatically inferred from the running application.
We found that @financial-times/dotcom-middleware-app-context demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 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
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.