@amitport/useful
v0.5.2
Published
useful for koa+angular apps
Downloads
14
Readme
useful-http
a useful http server
Install
$ npm install --save useful-http
Usage
var usefulHttpBuilder = require('useful-http');
httpServer = usefulHttpBuilder(
{
staticDirs: ['some-static-dir'],
serverPagesDir: 'server-pages-dir',
robots: 'Disallow: /',
httpLogStream: {write: () => {}}
}
)
.configureSecurity()
.handleRobots()
.log()
.compress()
.serveFonts()
.renderIndex()
.parseBody()
.serveStatic()
.handleErrors()
.build();
// got a useful node http server that is built using express
// start listening on port 8080
httpServer.listen(8080, cb);
// can close
httpServer.close(cb);
License
Apache-2.0 © Amit Portnoy