diff --git a/server/index.js b/server/index.js index 21ed7ac..1ba6f2b 100644 --- a/server/index.js +++ b/server/index.js @@ -34,9 +34,6 @@ app.use((req, res, next) => { // Parse JSON bodies app.use(express.json()); -// Serve static files from the overlay directory -app.use(express.static(path.join(__dirname, '..', 'overlay'))); - // Image proxy — fetches album art server-side so OBS can display it app.get('/api/image-proxy', async (req, res) => { const url = req.query.url; @@ -88,6 +85,9 @@ app.post('/api/now-playing', (req, res) => { res.json(currentState); }); +// Serve static files from the overlay directory (after API routes) +app.use(express.static(path.join(__dirname, '..', 'overlay'))); + // Send current state to newly connected WebSocket clients wss.on('connection', (ws) => { ws.send(JSON.stringify(currentState));