Meutel
0d0f564475
boostrap: start webserver, router catches requests routeur: create outputter and endpoint, trigger actions outputter: write in specified format action: act on resource
23 lines
400 B
JavaScript
23 lines
400 B
JavaScript
/**
|
|
* Config module.
|
|
* TODO license
|
|
*/
|
|
|
|
var config = exports;
|
|
/**
|
|
* Loads config from config file
|
|
*/
|
|
config.loadconfig=function(configfile, callback) {
|
|
require('fs').readFile(
|
|
configfile, {encoding:'utf8'},
|
|
function(err, data) {
|
|
if (err) callback(err);
|
|
try {
|
|
var config = JSON.parse(data);
|
|
callback(null, config);
|
|
} catch (err) {
|
|
callback(err);
|
|
}
|
|
});
|
|
};
|