Spaces:
Runtime error
Runtime error
| app.get("/logs", (req, res) => { | |
| try { | |
| if (fs.existsSync("/paperclip/bootstrap_logs.txt")) { | |
| const logs = fs.readFileSync("/paperclip/bootstrap_logs.txt", "utf-8"); | |
| res.status(200).set("Content-Type", "text/plain").send(logs); | |
| } else { | |
| res.status(200).set("Content-Type", "text/plain").send("Logs not available yet. Please wait..."); | |
| } | |
| } catch (e) { | |
| res.status(500).set("Content-Type", "text/plain").send("Error: " + String(e)); | |
| } | |
| }); | |