import express from "express"; import path from "path"; import { fileURLToPath } from "url"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const app = express(); const PORT = process.env.PORT || 7860; // Serve static files (index.html, style.css, etc.) app.use(express.static(__dirname)); // Example API route app.get("/api/hello", (req, res) => { res.json({ message: "Hello from Quantum Genesis Frontier!" }); }); // Default route — serve index.html app.get("*", (req, res) => { res.sendFile(path.join(__dirname, "index.html")); }); // Start server app.listen(PORT, "0.0.0.0", () => { console.log(`🚀 Server running on http://0.0.0.0:${PORT}`); });