src/server.ts
Entrytypescript16 lines0.4 KBProcess entry point: checks the database, builds the app and starts listening.
Symbols:
import { createApp } from './app';
import { env } from './config/env';
import { pool } from './db/client';
async function main() {
await pool.query('SELECT 1');
const app = createApp();
app.listen(env.PORT, () => {
console.log('acme-shop-api listening on ' + env.PORT);
});
}
main().catch((err) => {
console.error('Failed to start', err);
process.exit(1);
});