cziip / server.js
Reaperxxxx's picture
Create server.js
a5569fd verified
Raw
History Blame Contribute Delete
500 Bytes
const express = require('express');
const path = require('path');
const app = express();
const port = 7860;
// Serve static files from the current directory
app.use(express.static(path.join(__dirname, 'offline-games-hub')));
// Serve index.html for all routes (Single Page App behavior)
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'offline-games-hub', 'index.html'));
});
app.listen(port, () => {
console.log(`Offline Games Hub is running at http://localhost:${port}`);
});