LoRaWAN-Signal-Mapping/server/bootstrap/container.mjs

30 lines
683 B
JavaScript
Raw Normal View History

"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),
});
2019-05-23 20:01:32 +00:00
c.loadModules("../Repos.SQLite/*.mjs", {
register: a.asClass,
lifetime: a.Lifetime.SINGLETON
});
export default c;