feat: add Drizzle enums for schema
Made-with: Cursor
This commit is contained in:
26
src/server.ts
Normal file
26
src/server.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'dotenv/config';
|
||||
import { buildApp } from './app.js';
|
||||
import { env } from './config/env.js';
|
||||
|
||||
async function main() {
|
||||
const app = await buildApp();
|
||||
|
||||
try {
|
||||
await app.listen({ port: env.PORT, host: env.HOST });
|
||||
app.log.info({ port: env.PORT }, 'Server started');
|
||||
} catch (err) {
|
||||
app.log.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const shutdown = async () => {
|
||||
app.log.info('Shutting down...');
|
||||
await app.close();
|
||||
process.exit(0);
|
||||
};
|
||||
|
||||
process.on('SIGINT', shutdown);
|
||||
process.on('SIGTERM', shutdown);
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user