🚀 DAY 2 OF LAUNCH WEEK: Unify Your Security Stack with Socket Basics.Learn more →
Socket
Book a DemoInstallSign in
Socket

@financial-times/dotcom-middleware-app-context

Package Overview
Dependencies
Maintainers
11
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@financial-times/dotcom-middleware-app-context

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.

latest
npmnpm
Version
13.3.0
Version published
Maintainers
11
Created
Source

@financial-times/dotcom-middleware-app-context

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.

Getting started

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.

Options

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

Package last updated on 01 Oct 2025

Did you know?

Socket

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.

Install

Related posts