Created
March 27, 2016 17:07
-
-
Save EvanHahn/860d3dae418d5e1c45e4 to your computer and use it in GitHub Desktop.
helmetjs/helmet#117 example app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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