node-static
node-static copied to clipboard
how to override mime type for some file extensions?
want to change some of the file's mime type, is there any api? or just interpolate node response?
Currently no.. but PR #184 would allow something like this:
var file = new static.Server('./public');
require('http').createServer(function (request, response) {
request.addListener('end', function () {
response.setHeader('Content-Type', 'text/html') // explicitly override content type here
file.serve(request, response);
}).resume();
}).listen(8080);
Actually this issue is a dupe of #169