bkg
v0.0.10
Published
Simple static file server daemon
Downloads
10
Readme
bkg
Installation
Install with npm.
npm install bkg
or Clone from github
git clone http://github.com/sgen/bkg
Usage
Create a Daemon:
var bkg = require('bkg');
var daemon = bkg.daemon({
cmd: 'node',
args: ['server.js'],
name: 'my-daemon'
});
daemon.serve().then(function() {
// do something
}).catch(function(e) {
console.error(e);
});
daemon.kill().then(function() {
// do something
}).catch(function(e) {
console.error(e);
});
Create a server
var bkg = require('bkg');
bkg.server({
dir : 'static-files',
port: 8000
}).serve().catch(function(e) {
console.error(e);
});