express_web_server
v1.0.5
Published
express server module
Downloads
9
Maintainers
Readme
Simplified Express Server.
Usage
$ npm install express_web_server
var serverModule = require('express_web_server');
var Promise = require('bluebird');
var conf = {
web: {
host: 'localhost',
port: 3007,
views: '/webapp', // Optional
static: '/views', // Optional
root:'' // Declare this from server file using __dirname
}
};
conf.web.root = __dirname;
function ready() {
var app = new serverModule(conf); // Pass conf
return new Promise(function () {
app.createServer()
.then(function (result) {
if (result && result.status) {
// get the app from result.app and use it
console.log("Success");
} else {
console.log("Failed");
}
})
.catch(function (err) {
throw new Error(err);
});
});
}
ready();