2025-11-24 14:20:32 -06:00

19 lines
440 B
JavaScript

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);
});