Skip to content

Instantly share code, notes, and snippets.

@EvanHahn
Created June 24, 2014 20:58
Show Gist options
  • Save EvanHahn/8249dec57d9bfc557b4a to your computer and use it in GitHub Desktop.
Save EvanHahn/8249dec57d9bfc557b4a to your computer and use it in GitHub Desktop.
Dealing with Helmet issue #55.
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");
});
{
"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