Files
Advanced-Raid-Calculator/server.js

17 lines
480 B
JavaScript

const express = require('express');
const path = require('path');
const app = express();
const PORT = process.env.PORT || 3000;
// Serve static files from the current directory
app.use(express.static(__dirname));
// Fallback to index.html for any other requests (SPA behavior, though this is a simple page)
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'index.html'));
});
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});