Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var dataPath = args.d || Path.resolve(__dirname, '../output');
var options = {
root: webPath,
cache: -1,
showDir: true,
autoIndex: true,
before: [
ecstatic({ root: jsPath, baseDir: '/js' }),
ecstatic({ root: libPath, baseDir: '/lib' }),
ecstatic({ root: dataPath, baseDir: '/data' }),
server.newRouter(dataPath)
]
};
var webServer = httpServer.createServer(options);
/*eslint-disable no-console*/
webServer.listen(port, host, function() {
console.log(ansi.yellow('Starting up http-server'));
console.log(ansi.cyan('listening on ' + host + ':' + port));
console.log(ansi.cyan('serving "/" files from ' + webPath));
console.log(ansi.cyan('serving "/js" files from ' + jsPath));
console.log(ansi.cyan('serving "/lib" files from ' + libPath));
console.log(ansi.cyan('serving "/data" files from ' + dataPath));
console.log('Hit CTRL-C to stop the server');
});
['SIGINT', 'SIGTERM'].forEach(function(event) {
process.on(event, function() {