first commit
Some checks failed
CI / Validate frontend and API (push) Failing after 7m27s

This commit is contained in:
Cauê Faleiros
2026-08-31 12:38:34 -03:00
parent 684f929f28
commit 701788ea08
40 changed files with 5396 additions and 380 deletions

25
server/src/index.ts Normal file
View File

@@ -0,0 +1,25 @@
import { buildApp } from './app.js';
import { config } from './config.js';
import { closePool } from './db/pool.js';
const app = buildApp();
async function start() {
try {
await app.listen({ host: '0.0.0.0', port: config.API_PORT });
} catch (error) {
app.log.error(error);
await closePool();
process.exit(1);
}
}
for (const signal of ['SIGINT', 'SIGTERM']) {
process.once(signal, () => {
app.close()
.then(closePool)
.finally(() => process.exit(0));
});
}
void start();