Spaces:
Runtime error
Runtime error
| cat << 'INNER_EOF' > patch_logs_snippet.ts | |
| 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 refresh in a few seconds."); | |
| } | |
| } catch (e) { | |
| res.status(500).set("Content-Type", "text/plain").send("Error: " + String(e)); | |
| } | |
| }); | |
| INNER_EOF | |
| sed -i '/app.use(httpLogger);/r patch_logs_snippet.ts' server/src/app.ts | |