all files / direwolf/ index.js

90% Statements 9/10
50% Branches 1/2
100% Functions 1/1
90% Lines 9/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29                                       
/**
 * Created by zdy on 16/9/28.
 */
 
'use strict';
 
const App = require('./lib/core/application');
const Config = require('./lib/core/config');
 
module.exports = {
    start: function (options) {
        Iif (!options) {
            throw new Error('no param [baseDir]!');
        }
        // 配置
        const config = new Config(options);
 
        // 应用
        const app = new App(config);
 
        app.logger.info(`server start on: ${config.port}`);
        app.listen(config.port);
 
        return app;
    },
    logger: require('./lib/core/logger')
};