Skip to content

Instantly share code, notes, and snippets.

@EvanHahn

EvanHahn/app.js

Created Mar 27, 2016
Embed
What would you like to do?
helmetjs/helmet#117 example app
var connect = require('connect')
var csp = require('helmet-csp')
var app = connect()
app.use(csp({
directives: {
mediaSrc: ['media.example.com']
}
}))
app.use(function (req, res) {
res.end('Hello world!')
})
app.listen(3000, function () {
console.log('app started on port 3000')
})
{
"private": true,
"scripts": {
"start": "node app"
},
"dependencies": {
"connect": "^3.4.1",
"helmet-csp": "^1.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment