Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Starefossen/node-express-project-x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@starefossen/express-project-x

Build status Codacy grade Codacy coverage NPM downloads NPM version Node version Dependency status

X-Project headers for Express.js applications.

Install

$ npm install @starefossen/express-project-x --save

Usage

const xapp = require('@starefossen/express-project-x');

Simple

The simple configuration reads your package.json and will set the following headers if their values are defined in your package.json:

  • X-App-Name
  • X-App-Version
  • X-App-Author
  • X-App-Homepage
const xapp = require('@starefossen/express-project-x');

app.use(xapp.middleware);

Advanced

The advanced configuration takes in a configuration object and an optional data object.

const xapp = require('@starefossen/express-project-x');
const data = require('./package');

app.use(xapp({
  name: true,
  version: false,
  license: true,
}, data));