This is an example project for this blog post
Using a Content Security Policy is a great tool to defend yourself against cross-site scripting (XSS) attacks. This repo contains several examples of how to / how not to do things.
To run this example:
git clone https://github.com/Graham42/sample-csp-with-inline-data.git
cd sample-csp-with-inline-data
npm install
npm startIf you're interested in the code I recommend starting in the app.js file