Spaces:
Sleeping
Sleeping
Download server.js from Reaperxxxx/bex: direct link, hf CLI and curl.
- Browser
- Download file 621 Bytes
-
https://huggingface.co/spaces/Reaperxxxx/bex/resolve/main/server.js
- Command line
-
hf download hf://spaces/Reaperxxxx/bex/server.js
-
curl -L -o server.js https://huggingface.co/spaces/Reaperxxxx/bex/resolve/main/server.js
621 Bytes
| // server.js | |
| 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 from /public | |
| app.use(express.static(path.join(__dirname, "public"), { extensions: ["html"] })); | |
| // Default route (serve index.html) | |
| app.get("/", (req, res) => { | |
| res.sendFile(path.join(__dirname, "public", "index.html")); | |
| }); | |
| app.listen(PORT, "0.0.0.0", () => { | |
| console.log(`✅ Server running at http://localhost:${PORT}`); | |
| }); |