Are you using Express with node js and want to get rid of "X-Powered-By" response header or you want to replace it with you domain name ???
all you need to do is just write a simple middleware. First we'll see how to remove it and then how to customize.
add this line of code to your app.js.
to modify you have to write a simple middle ware just like this.
now try restarting node js service and refresh your webpage to see the changes.
gil...
all you need to do is just write a simple middleware. First we'll see how to remove it and then how to customize.
add this line of code to your app.js.
// x-powered by ionos app.disable('x-powered-by'); //to disable
to modify you have to write a simple middle ware just like this.
// x-powered by app.use(function (req, res, next) { res.header('X-powered-by', 'geekinlinux') next();});
now try restarting node js service and refresh your webpage to see the changes.
gil...
0 Comments