Spaces:
Paused
Paused
| import express from "express"; | |
| const app = express(); | |
| app.use(express.json()); | |
| app.use(express.static("public")); | |
| const PORT = process.env.PORT || 7860; | |
| /* HEALTH CHECK (ÇOK ÖNEMLİ) */ | |
| app.get("/", (req, res) => { | |
| res.send("🚀 SAAS IS LIVE"); | |
| }); | |
| /* TEST ENDPOINT */ | |
| app.get("/ping", (req, res) => { | |
| res.json({ status: "ok" }); | |
| }); | |
| /* LOGIN MOCK */ | |
| app.post("/auth", (req, res) => { | |
| res.json({ token: "demo-token-123" }); | |
| }); | |
| /* RUN MOCK */ | |
| app.post("/run", (req, res) => { | |
| res.json({ output: "Code executed (mock)" }); | |
| }); | |
| /* AI MOCK */ | |
| app.post("/ai", (req, res) => { | |
| res.json({ result: "// fixed code here" }); | |
| }); | |
| /* SAVE MOCK */ | |
| app.post("/save", (req, res) => { | |
| res.json({ ok: true }); | |
| }); | |
| app.listen(PORT, "0.0.0.0", () => { | |
| console.log("LEVEL 3 SAAS RUNNING 🚀 on", PORT); | |
| }); |