I have the following:
var express = require('express'),
app = express.createServer();
app.get("/offline.manifest", function(req, res){
res.contentType("text/cache-manifest");
res.end("CACHE MANIFEST");
});
app.listen(8561);
The network tab in Chrome says it's text/plain
. Why isn't it setting the header?
The code above works, my problems were caused by a linking to an old version of express-js
res.send(obj)
to send objects as JSON. Better thanres.end(JSON.stringify(obj))
– Endamoeba