This commit is contained in:
seb
2026-06-23 11:04:07 +02:00
commit 667f498573
19 changed files with 4299 additions and 0 deletions

25
src/index.js Normal file
View File

@@ -0,0 +1,25 @@
import './config/env.js';
import { startApi, stopApi } from './api/index.js';
import { closeDb } from './db/client.js';
async function shutdown() {
await stopApi();
try {
closeDb();
} catch (error) {
console.error('Failed to close database:', error);
process.exitCode = 1;
}
}
process.on('SIGINT', () => {
shutdown().then(() => process.exit(0));
});
process.on('SIGTERM', () => {
shutdown().then(() => process.exit(0));
});
startApi().catch((err) => {
console.error('Failed to start API:', err.message);
process.exit(1);
});