express_web_server
express server module
Last updated 6 months ago by neelstephen .
MIT · Original npm · Tarball · package.json
$ cnpm install express_web_server 
SYNC missed versions from official npm registry.

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();

Current Tags

  • 1.0.5                                ...           latest (6 months ago)

6 Versions

  • 1.0.5                                ...           6 months ago
  • 1.0.4                                ...           6 months ago
  • 1.0.3                                ...           6 months ago
  • 1.0.2                                ...           6 months ago
  • 1.0.1                                ...           6 months ago
  • 1.0.0                                ...           6 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 12
Dependencies (9)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |