Meutel
0d0f564475
boostrap: start webserver, router catches requests routeur: create outputter and endpoint, trigger actions outputter: write in specified format action: act on resource
36 lines
603 B
JavaScript
36 lines
603 B
JavaScript
/**
|
|
* TODO license
|
|
* Bouquins module.
|
|
*/
|
|
|
|
var config = require('./util/config'),
|
|
logger = require('./util/logger'),
|
|
Router = require('./router/router'),
|
|
bouquins = exports;
|
|
|
|
var router = null;
|
|
/**
|
|
* Load config file.
|
|
*/
|
|
bouquins.loadconfig = function(configfile, callback) {
|
|
config.loadconfig(configfile, callback);
|
|
};
|
|
/**
|
|
* Init logger.
|
|
*/
|
|
bouquins.initLogger = function() {
|
|
if (config.debugLevel) {
|
|
logger.debugLevel = config.debugLevel;
|
|
}
|
|
return logger;
|
|
}
|
|
/**
|
|
* Make main router.
|
|
*/
|
|
bouquins.makeRouter = function() {
|
|
if (!router) {
|
|
router = new Router();
|
|
}
|
|
return router;
|
|
}
|