Update crawl.ts

This commit is contained in:
Nicolas 2024-09-05 13:03:43 -03:00
parent eb03a81152
commit c6f1d80992
1 changed files with 3 additions and 1 deletions

View File

@ -155,10 +155,12 @@ export async function crawlController(
await callWebhook(req.auth.team_id, id, null, req.body.webhook, true, "crawl.started"); 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({ return res.status(200).json({
success: true, success: true,
id, id,
url: `${req.protocol}://${req.get("host")}/v1/crawl/${id}`, url: `${protocol}://${req.get("host")}/v1/crawl/${id}`,
}); });
} }