20 lines
461 B
TypeScript
20 lines
461 B
TypeScript
import 'dotenv/config';
|
|
import { buildApp } from './app.js';
|
|
import { runMigrations } from './db/migrate.js';
|
|
|
|
const PORT = Number(process.env.PORT || 6001);
|
|
|
|
async function main() {
|
|
console.log('Running migrations...');
|
|
runMigrations();
|
|
|
|
const app = await buildApp();
|
|
await app.listen({ port: PORT, host: '0.0.0.0' });
|
|
console.log(`Server running on http://localhost:${PORT}`);
|
|
}
|
|
|
|
main().catch((err) => {
|
|
console.error(err);
|
|
process.exit(1);
|
|
});
|