forked from qantra-io/axion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
30 lines (23 loc) · 807 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const config = require('./config/index.config.js');
const Cortex = require('ion-cortex');
const ManagersLoader = require('./loaders/ManagersLoader.js');
const mongoDB = config.dotEnv.MONGO_URI? require('./connect/mongo')({
uri: config.dotEnv.MONGO_URI
}):null;
const cache = require('./cache/cache.dbh')({
prefix: config.dotEnv.CACHE_PREFIX ,
url: config.dotEnv.CACHE_REDIS
});
const cortex = new Cortex({
prefix: config.dotEnv.CORTEX_PREFIX,
url: config.dotEnv.CORTEX_REDIS,
type: config.dotEnv.CORTEX_TYPE,
state: ()=>{
return {}
},
activeDelay: "50ms",
idlDelay: "200ms",
});
const managersLoader = new ManagersLoader({config, cache, cortex});
const managers = managersLoader.load();
managers.userServer.run();