openagenticresearch / patch_url_endpoint.ts
Leon4gr45's picture
Upload folder using huggingface_hub
0872831 verified
app.get("/url", (req, res) => {
try {
if (fs.existsSync("/paperclip/bootstrap_logs.txt")) {
const logs = fs.readFileSync("/paperclip/bootstrap_logs.txt", "utf-8");
const match = logs.match(/https?:\/\/[^\s]+/);
if (match) {
res.status(200).set("Content-Type", "text/plain").send(match[0]);
} else {
res.status(200).set("Content-Type", "text/plain").send("URL not found in logs yet.");
}
} else {
res.status(200).set("Content-Type", "text/plain").send("Logs not available yet.");
}
} catch (e) {
res.status(500).set("Content-Type", "text/plain").send("Error: " + String(e));
}
});