Open brettz9 opened 6 years ago
Let's say "sometimes" you don't want to serve something.
require('http').createServer(function (request, response) {
request.addListener('end', function () {
// Serve files! ... or not?
if(request.url.includes('mom')) {
nodeStatic.serveFile('/nothing-about-mom.html', 404, {}, request, response);
}
nodeStatic.serve(request, response);
}).resume();
}).listen(8080);
Yes, sure, thanks--I should have mentioned though that I was hoping for a CLI option...
@brettz9 at least I don't see anything here https://github.com/cloudhead/node-static/blob/master/bin/cli.js
This would be particularly helpful for an easy means to set up production static servers on the root of one's repository without fear of exposing .git
.
Is there any means, whether through a generic filter by file name, or by config specifically targeting hidden files/folders, that one may prevent/enable hidden files from being served? Thanks!