File size: 501 Bytes
714fc32
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

  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));
    }
  });