Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including response-powered-by with all npm packages installed. Try it out:

var responsePoweredBy = require("response-powered-by")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

response-powered-by v1.0.4

Middleware to set the X-Powered-By header returned by Express

response-powered-by

Middleware to set or remove the X-Powered-By header returned by Express

This middleware sets or removes the X-Powered-By header on HTTP responses served by Express framework.

X-Powered-By key header specifies the technology supporting a web application. This header is used to gather metrics about the web.

Installation

If you want use response-powered-by you have to install it. There are two methods for that: In your package.json add the following item:

"response-powered-by": "version"

then digit

npm install

Example:

"response-powered-by": "*" for the latest version
"response-powered-by": "1.0.0" for the version 1.0.0

OR

launch this command:

npm install response-powered-by --save

Use

var responsePoweredBy = require('response-powered-by');

//Import some other required modules
var express = require('express');
var app = express();
//Some other configuration for the express app

app.use(responsePoweredBy("Your cutom string for X-Powered-By header"));

This middleware sets the X-Powered-By header to a value passed in input, but if that value is not a string or it's undefined or null this header will be removed from the response.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free