Update TTNAppServer to use awilix DI container

master
Starbeamrainbowlabs 4 years ago
parent 0d3edd0a93
commit ed256c1e76
  1. 3
      server/index.mjs
  2. 5
      server/ttn-app-server/TTNAppServer.mjs

@ -5,7 +5,6 @@
import c from './bootstrap/container.mjs';
import show_help from './help.mjs';
import TTNAppServer from './ttn-app-server/TTNAppServer.mjs';
const settings = c.resolve("settings");
const a = c.resolve("ansi");
@ -48,7 +47,7 @@ if(extras.length < 1) {
switch(extras[0]) {
case "ttn-app-server":
let app_server = new TTNAppServer(settings);
let app_server = c.resolve("TTNAppServer");
app_server.run();
break;

@ -3,8 +3,9 @@
import ansi from '../Helpers/Ansi.mjs';
class TTNAppServer {
constructor(in_settings) {
this.settings = in_settings;
// Destructure the awilix container
constructor({ settings }) {
this.settings = settings;
}
run() {

Loading…
Cancel
Save