Files
sofia-traffic-info/server.mjs
Georgi Gardev 304d0eb1ea import order
2025-05-14 12:50:50 +03:00

22 lines
554 B
JavaScript

import express from 'express';
import { getStops, setStops } from './src/config.mjs';
import { departuresRouter } from './src/departures-router.mjs';
import { startScraper } from './src/runner.mjs';
const PORT = process.env.PORT || 3000;
if (getStops().length === 0) {
console.error('No stops configured. Please configure stops in config.json. Defaulting to [7].');
setStops([7]);
}
startScraper();
const app = express();
app.use(departuresRouter);
app.listen(PORT, () => {
console.log(`🚀 Server running at http://localhost:${PORT}`);
});