You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportasyncfunctionreplicateWebhook(req,res){constsecret=<REPLICATE_WEBHOOK_SECRET>;
if (!secret) {console.log("Skipping webhook validation. To validate webhooks, set REPLICATE_WEBHOOK_SIGNING_SECRET");constbody=awaitreq.json();returnres.json({detail: "Webhook received (but not validated)"},{status: 200});}
const webhookIsValid = await validateWebhook(req, secret);
if (!webhookIsValid) {returnres.json({detail: "Webhook is invalid"},{status: 401});}
const webhookData = JSON.parse(req.body.toString());
const {id,output,status} = webhookData;
console.log("From Replicate: ", id, status);
/* WORKING WITH THE DATA RECIEVED"
return res.json(
{detail: "Webhook received and succeeded"},
{status: 200}
);
}
Using the webhooks routes: app.use("/replicateWebhook", replicateWebhookRoutes);
I just need the output, status and the id from the request.body but it says that the Payload is too large.
Need help
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
I've set a webhook handler to get logs for my trainings:
Handler:
Using the webhooks routes:
app.use("/replicateWebhook", replicateWebhookRoutes);
I just need the output, status and the id from the request.body but it says that the Payload is too large.
Need help
The text was updated successfully, but these errors were encountered: