Import source: backend/src/server

Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
arsam
2026-09-18 23:13:29 +03:30
parent 305f5b3804
commit 07422eadcd
+26
View File
@@ -0,0 +1,26 @@
import { createApp } from './app.js';
import { assertProductionEnv, env } from './config/env.js';
assertProductionEnv();
const app = await createApp();
const server = app.listen(env.port, () => {
process.stdout.write(`CShare API listening on http://localhost:${env.port}\n`);
});
server.requestTimeout = 10 * 60 * 1000;
server.headersTimeout = 65 * 1000;
function shutdown(signal: string) {
process.stdout.write(`${signal} received; closing HTTP server\n`);
server.close((err) => {
if (err) {
console.error(err);
process.exit(1);
}
process.exit(0);
});
}
process.on('SIGTERM', () => shutdown('SIGTERM'));
process.on('SIGINT', () => shutdown('SIGINT'));