express-standard

Easy method to define standard express headers and assist with Content-Security-Policy including social media widgets

Usage no npm install needed!

<script type="module">
  import expressStandard from 'https://cdn.skypack.dev/express-standard';
</script>

README

express-standard NPM version Build Status Dependency Status License

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));

License: MIT :unlock: