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