diff options
Diffstat (limited to 'common/src/main/webapp/usageguide/appserver/node_modules/mongoose/static.js')
-rw-r--r-- | common/src/main/webapp/usageguide/appserver/node_modules/mongoose/static.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/static.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/static.js new file mode 100644 index 00000000..d84e59f7 --- /dev/null +++ b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/static.js @@ -0,0 +1,24 @@ + +var static = require('node-static'); +var server = new static.Server('.', {cache: 0}); + +require('http').createServer(function(req, res) { + if (req.url === '/favicon.ico') { + req.destroy(); + res.statusCode = 204; + return res.end(); + } + + req.on('end', function() { + server.serve(req, res, function(err) { + if (err) { + console.error(err, req.url); + res.writeHead(err.status, err.headers); + res.end(); + } + }); + }); + req.resume(); +}).listen(8088); + +console.error('now listening on http://localhost:8088'); |