1
0
Fork 0

main app file

This commit is contained in:
Ruben Meyer 2019-06-01 22:35:40 +02:00
parent 4f13f64fc6
commit 898347e460
1 changed files with 34 additions and 0 deletions

34
app.js Normal file
View File

@ -0,0 +1,34 @@
/*
* This file is part of the authRXBN single sign-on package.
*
* (c) Ruben Meyer <contact@rxbn.de>
*/
// GDS: Global Data System
global['gds'] = {
debug: (process.env.NODE_ENV === 'debug') ? 1 : 0,
db: null,
cache: {},
cfg: require(__dirname+'/bin/config')
};
global['modules'] = {};
global['__dirname'] = __dirname;
/**
* load modules
*/
let load = (name) => {
return require(__dirname+'/bin/'+name+'/module');
};
global['modules'].events = load('events'); // event handler
global['modules'].cli = load('cli'); // command line interface
global['modules'].logs = load('logs'); // log handler
global['modules'].database = load('database'); // database service
global['modules'].web = load('web'); // web server
global['modules'].auth = load('auth'); // authentication handler
// start web server
global['modules'].web.start();