@etrigan/config-express-middleware
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Etrigan Config express middleware

Express middleware to make config available on your request

Usage

import { expressConfigMiddleware } from '@etrigan/config-express-middleware'

let config: MyConfig

express.use(expressConfigMiddleware(() => config))

Updating config

The config will be fetched for each request. Config should never be mutated, instead set a new value for the config variable above, then the next request will get the new config. In flight requests will keep their old config until completion.

Readme

Keywords

none

Package Sidebar

Install

npm i @etrigan/config-express-middleware

Weekly Downloads

772

Version

1.0.1

License

MIT

Unpacked Size

4.29 kB

Total Files

7

Last publish

Collaborators

  • wimomisterx
  • jakeginnivan