Created
June 24, 2014 20:58
-
-
Save EvanHahn/8249dec57d9bfc557b4a to your computer and use it in GitHub Desktop.
Dealing with Helmet issue #55.
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 path = require("path"); | |
var connect = require("connect"); | |
var favicon = require("serve-favicon"); | |
var helmet = require("helmet"); | |
var app = connect(); | |
app.use(helmet.defaults()); | |
var faviconPath = path.resolve(__dirname, "favicon.ico"); | |
app.use(favicon(faviconPath)); | |
app.use(function(req, res) { | |
res.set("Content-Type", "text/html"); | |
res.end("hello world"); | |
}); | |
app.listen(1337, function() { | |
console.log("Server started"); | |
}); |
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.0.x", | |
"helmet": "0.2.x", | |
"serve-favicon": "2.0.x" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment