How to get rid of X-Powered-By response header in Node.js Express?

Sometimes, we want to get rid of X-Powered-By response header in Node.js Express.

In this article, we’ll look at how to get rid of X-Powered-By response header in Node.js Express.

How to get rid of X-Powered-By response header in Node.js Express?

To get rid of X-Powered-By response header in Node.js Express, we can use the app.disable method.

For instance, we write

app.disable('x-powered-by');

to disable the 'x-powered-by' option which removes the X-Powered-By response header in our Express app.

Conclusion

To get rid of X-Powered-By response header in Node.js Express, we can use the app.disable method.