refactor(plugins): DO NOT MERGE server-side support for new plugins API added
This commit is contained in:
parent
bf6b5c0958
commit
308cd76656
4 changed files with 391 additions and 402 deletions
14
lib/app.js
14
lib/app.js
|
|
@ -5,7 +5,7 @@ var https = require('https');
|
|||
var express = require('express');
|
||||
var LamassuConfig = require('lamassu-config');
|
||||
var routes = require('./routes');
|
||||
var Trader = require('./trader');
|
||||
var tmpName = require('./tmpName');
|
||||
var PostgresqlInterface = require('./postgresql_interface');
|
||||
var logger = require('./logger');
|
||||
|
||||
|
|
@ -14,7 +14,6 @@ module.exports = function (options) {
|
|||
var connectionString;
|
||||
var server;
|
||||
var config;
|
||||
var trader;
|
||||
var db;
|
||||
|
||||
connectionString = options.postgres ||
|
||||
|
|
@ -22,7 +21,8 @@ module.exports = function (options) {
|
|||
|
||||
config = new LamassuConfig(connectionString);
|
||||
db = new PostgresqlInterface(connectionString);
|
||||
trader = new Trader(db);
|
||||
tmpName.init(db);
|
||||
|
||||
|
||||
config.load(function (err, config) {
|
||||
if (err) {
|
||||
|
|
@ -30,8 +30,8 @@ module.exports = function (options) {
|
|||
throw err;
|
||||
}
|
||||
|
||||
trader.configure(config);
|
||||
trader.startPolling();
|
||||
tmpName.configure(config);
|
||||
tmpName.startPolling();
|
||||
});
|
||||
|
||||
config.on('configUpdate', function () {
|
||||
|
|
@ -40,7 +40,7 @@ module.exports = function (options) {
|
|||
return logger.error('Error while reloading config');
|
||||
}
|
||||
|
||||
trader.configure(config);
|
||||
tmpName.configure(config);
|
||||
logger.info('Config reloaded');
|
||||
});
|
||||
});
|
||||
|
|
@ -89,7 +89,7 @@ module.exports = function (options) {
|
|||
routes.init({
|
||||
app: app,
|
||||
lamassuConfig: config,
|
||||
trader: trader,
|
||||
tmpName: tmpName,
|
||||
authMiddleware: authMiddleware,
|
||||
mock: options.mock
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue