const express = require('express');
const path = require('path');

/**
 * Neon Snake Game Server Module
 * Single-player game - no socket.io needed
 */
module.exports = function(ioInstance, appInstance) {
    const router = express.Router();
    
    // Serve static files for Neon Snake
    if (appInstance) {
        router.use(express.static(path.join(__dirname, '../public')));
        appInstance.use('/games/neon-snake', router);
    }
    
    console.log('Neon Snake game mounted at /games/neon-snake');
    
    return router;
};

// Standalone execution (if needed for development)
if (require.main === module) {
    const app = express();
    const http = require('http');
    const server = http.createServer(app);
    
    app.use(express.static(path.join(__dirname, '../public')));
    
    const PORT = process.env.PORT || 3003;
    server.listen(PORT, () => {
        console.log(`Neon Snake standalone server listening on *:${PORT}`);
    });
}
