Leon4gr45 commited on
Commit
714fc32
·
verified ·
1 Parent(s): 8d4151b

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. patch_logs_again.ts +14 -0
  2. server/src/app.ts +14 -0
patch_logs_again.ts ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ app.get("/logs", (req, res) => {
3
+ try {
4
+ if (fs.existsSync("/paperclip/bootstrap_logs.txt")) {
5
+ const logs = fs.readFileSync("/paperclip/bootstrap_logs.txt", "utf-8");
6
+ res.status(200).set("Content-Type", "text/plain").send(logs);
7
+ } else {
8
+ res.status(200).set("Content-Type", "text/plain").send("Logs not available yet. Please wait...");
9
+ }
10
+ } catch (e) {
11
+ res.status(500).set("Content-Type", "text/plain").send("Error: " + String(e));
12
+ }
13
+ });
14
+
server/src/app.ts CHANGED
@@ -88,6 +88,20 @@ export async function createApp(
88
  ) {
89
  const app = express();
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  app.use(express.json({
92
  // Company import/export payloads can inline full portable packages.
93
  limit: "10mb",
 
88
  ) {
89
  const app = express();
90
 
91
+ app.get("/logs", (req, res) => {
92
+ try {
93
+ if (fs.existsSync("/paperclip/bootstrap_logs.txt")) {
94
+ const logs = fs.readFileSync("/paperclip/bootstrap_logs.txt", "utf-8");
95
+ res.status(200).set("Content-Type", "text/plain").send(logs);
96
+ } else {
97
+ res.status(200).set("Content-Type", "text/plain").send("Logs not available yet. Please wait...");
98
+ }
99
+ } catch (e) {
100
+ res.status(500).set("Content-Type", "text/plain").send("Error: " + String(e));
101
+ }
102
+ });
103
+
104
+
105
  app.use(express.json({
106
  // Company import/export payloads can inline full portable packages.
107
  limit: "10mb",