express-standard
v0.4.1
Published
Easy method to define standard express headers and assist with Content-Security-Policy including social media widgets
Downloads
106
Readme
express-standard
Easy method to define standard express headers
Install :hammer:
npm install express-standard
Usage :wrench:
headers = require('express-standard');
app.use(
headers.set({
"x-powered-by": "Awesomeness"
}));
headers.add({
"Basic-Content-Security": "default-src 'self'"
});
app.use(headers.handle);
Powered By Sample :bulb:
app.use(headers.powered_by('Awesomeness'));
console.log(headers.get()) // { x-powered-by:"Awesomeness"}
SSL Only Basic Content Security Policy :bulb:
ssl_only = "default-src https:; script-src https: 'unsafe-inline'; style-src https: 'unsafe-inline'";
app.use(headers.set("Basic-Content-Security": ssl_only));