adding ci-cd workflow

This commit is contained in:
rafaelsideguide
2024-04-18 16:28:01 -03:00
parent 3e9e24aaf1
commit ddb3b25171
5 changed files with 177 additions and 12 deletions
+4 -10
View File
@@ -230,16 +230,10 @@ app.post("/v0/crawl", async (req, res) => {
});
app.post("/v0/crawlWebsitePreview", async (req, res) => {
try {
// make sure to authenticate user first, Bearer <token>
const authHeader = req.headers.authorization;
if (!authHeader) {
return res.status(401).json({ error: "Unauthorized" });
}
const token = authHeader.split(" ")[1]; // Extract the token from "Bearer <token>"
if (!token) {
return res.status(401).json({ error: "Unauthorized: Token missing" });
}
const { success, team_id, error, status } = await authenticateUser(req, res, "scrape");
if (!success) {
return res.status(status).json({ error });
}
// authenticate on supabase
const url = req.body.url;
if (!url) {