LoRaWAN-Signal-Mapping/server/bootstrap/container.mjs
Starbeamrainbowlabs 009d6335a0 Setup basic logging framework.
In the future, we might be able to use a proxy object here or some other 
wizadry? I'm not sure.
2019-05-29 11:59:40 +01:00

29 lines
683 B
JavaScript

"use strict";
import a from 'awilix';
import Ansi from '../Helpers/Ansi.mjs';
import Log from '../Helpers/Log.mjs';
import TTNAppServer from '../ttn-app-server/TTNAppServer.mjs';
import settings from './settings.mjs';
import database_init from '../bootstrap/database_init.mjs';
const c = a.createContainer({
injectionMode: a.InjectionMode.PROXY
});
c.register({
settings: a.asValue(settings),
ansi: a.asClass(Ansi).singleton(),
log: a.Class(Log).singleton(),
database: a.asFunction(database_init).singleton(),
TTNAppServer: a.asClass(TTNAppServer),
});
c.loadModules("../Repos.SQLite/*.mjs", {
register: a.asClass,
lifetime: a.Lifetime.SINGLETON
});
export default c;