feat(app): order schdeuler

This commit is contained in:
2025-10-15 14:27:54 -05:00
parent dfff8fc166
commit 94e1198f63
7 changed files with 243 additions and 3 deletions

View File

@@ -19,10 +19,13 @@ import { sendNotify } from "./src/pkg/utils/notify.js";
import { toNodeHandler } from "better-auth/node";
import { auth } from "./src/pkg/auth/auth.js";
import { apiHitMiddleware } from "./src/pkg/middleware/apiHits.js";
import { setupIoServer } from "./src/ws/server.js";
import { schedulerManager } from "./src/internal/logistics/controller/schedulerManager.js";
const main = async () => {
const env = validateEnv(process.env);
const PORT = Number(env.VITE_PORT) || 4200;
//create the logger
const log = createLogger({ module: "system", subModule: "main start" });
@@ -130,16 +133,18 @@ const main = async () => {
express.static(join(__dirname, "../frontend/dist"))
);
// server setup
const server = createServer(app);
// register app
setupRoutes(app, basePath);
// ws stuff
// ws + server stuff
const server = createServer(app);
setupIoServer(server, basePath);
// sub systems
printers();
schedulerManager();
// start the server up
server.listen(PORT, "0.0.0.0", () =>