const express = require('express'); const { initDb } = require('./db'); const app = express(); const PORT = 9000; app.use(express.json()); initDb().then(() => { app.get('/', (req, res) => { res.json({message : 'Server is running'}); }); app.listen(PORT, () => { console.log(`Server running on http://localhost:${PORT}`); }); }).catch(err => { console.error('Failed to initialize database:', err); });