Add an SQL DB abstraction layer
Because what self-respecting Enterprise(R) project doesn't have one of those?
This commit is contained in:
+6
-2
@@ -1,4 +1,5 @@
|
||||
import "dotenv/config";
|
||||
|
||||
import fs from "fs";
|
||||
import https from "https";
|
||||
import http from "http";
|
||||
@@ -11,21 +12,24 @@ import chunithm from "./chunithm";
|
||||
import diva from "./diva";
|
||||
import idz from "./idz";
|
||||
import idzPing from "./idz/ping";
|
||||
import { openDataSource } from "./sql";
|
||||
import * as Swb from "./switchboard";
|
||||
|
||||
const db = openDataSource();
|
||||
|
||||
const tls = {
|
||||
cert: fs.readFileSync("pki/server.pem"),
|
||||
key: fs.readFileSync("pki/server.key"),
|
||||
};
|
||||
|
||||
net.createServer(aimedb).listen(Swb.PORT_AIMEDB, Swb.HOST_INT);
|
||||
net.createServer(aimedb(db)).listen(Swb.PORT_AIMEDB, Swb.HOST_INT);
|
||||
http.createServer(allnet).listen(Swb.PORT_ALLNET, Swb.HOST_INT);
|
||||
https.createServer(tls, billing).listen(Swb.PORT_BILLING, Swb.HOST_INT);
|
||||
|
||||
http.createServer(chunithm).listen(Swb.PORT_CHUNITHM, Swb.HOST_INT);
|
||||
http.createServer(diva).listen(Swb.PORT_DIVA, Swb.HOST_INT);
|
||||
|
||||
net.createServer(idz).listen(Swb.PORT_IDZ.USERDB.TCP, Swb.HOST_INT);
|
||||
net.createServer(idz(db)).listen(Swb.PORT_IDZ.USERDB.TCP, Swb.HOST_INT);
|
||||
idzPing(10001, Swb.HOST_INT); // ?? tbd
|
||||
idzPing(Swb.PORT_IDZ.MATCH.UDP_SEND, Swb.HOST_INT);
|
||||
idzPing(Swb.PORT_IDZ.ECHO1, Swb.HOST_INT);
|
||||
|
||||
Reference in New Issue
Block a user