Skip to content

Instantly share code, notes, and snippets.

@EvanHahn

EvanHahn/app.js

Created Jun 24, 2014
Embed
What would you like to do?
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