Initial commit (unpacked platform)

This commit is contained in:
Sven (AAMOS AI)
2026-08-05 19:21:11 +07:00
commit ac5340195a
314 changed files with 57584 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import { loadConfig } from "./config.js";
import { buildServer } from "./server.js";
const config = loadConfig();
const app = await buildServer(config);
const shutdown = async (signal: string) => {
app.log.info(`${signal} mottagen stänger ner API:t.`);
await app.close();
process.exit(0);
};
process.on("SIGTERM", () => void shutdown("SIGTERM"));
process.on("SIGINT", () => void shutdown("SIGINT"));
try {
await app.listen({ port: config.API_PORT, host: "0.0.0.0" });
app.log.info(`API igång på :${config.API_PORT} (${config.NODE_ENV}, AAMOS=${config.AAMOS_MODE})`);
} catch (err) {
app.log.error(err);
process.exit(1);
}