Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Update crawl.ts

Nicolasc6f1d8099296
diff --git a/apps/api/src/controllers/v1/crawl.ts b/apps/api/src/controllers/v1/crawl.ts
index c2d5bdcaf..e0883fa8e 100644
--- a/apps/api/src/controllers/v1/crawl.ts
+++ b/apps/api/src/controllers/v1/crawl.ts
@@ -155,10 +155,12 @@ export async function crawlController(
await callWebhook(req.auth.team_id, id, null, req.body.webhook, true, "crawl.started");
}
+ const protocol = process.env.ENV === "local" ? req.protocol : "https";
+
return res.status(200).json({
success: true,
id,
- url: `${req.protocol}://${req.get("host")}/v1/crawl/${id}`,
+ url: `${protocol}://${req.get("host")}/v1/crawl/${id}`,
});
}