index.js 932 Bytes
var fs = require('fs');
var ini = require('ini');
var expresso = require('sate24-expresso');
var config = ini.parse(fs.readFileSync(__dirname + '/config.ini', 'utf-8'));

process.chdir(__dirname);

//var iniparser = require('iniparser');
//var config = iniparser.parseSync('./config.ini');

var aaaHost = config.globals.aaa_host;

var logger = require('sate24/logger.js').start();
var HttpServer = require('sate24/httpserver.js');
var aaa = require('sate24/aaa.js');
var partner = require('./gentong.js');

var matrix = aaa.prepareMatrix();

var options = {
    'aaa': aaa,
    'logger': logger,
    'config': config,
    'matrix': matrix,
    //'expresso_views': 'node_modules/sate24-expresso/views'
}

//var httpServer = HttpServer.start(config, {logger: logger});
var httpServer = HttpServer.start(config, options);
//HttpServer.setAaa(aaa);

partner.start(options);
aaa.start(config, partner, options);
expresso.start(options);