rdgr
rdgr•16mo ago

Http Route not working

Hi, I'm trying to create a route so I can send a webhook from a 3rd party to capture some event. The code I have is the following:
http.route({
path: '/test',
method: 'GET',
handler: httpAction(async (ctx, request) => {
console.log('HTTP GET', ctx, request)
return new Response(null, {
status: 200,
statusText: 'OK!',
})
}),
})
http.route({
path: '/test',
method: 'GET',
handler: httpAction(async (ctx, request) => {
console.log('HTTP GET', ctx, request)
return new Response(null, {
status: 200,
statusText: 'OK!',
})
}),
})
After updating my http.ts file, I can the the new function /test showing on my Dashboard > Functions. However, when I call the route using the provided development credentials, I'm always getting a 404.
curl -X GET https://generated-subdomain.convex.cloud/test
404 page not Found
curl -X GET https://generated-subdomain.convex.cloud/test
404 page not Found
To give context, this is to integrate with Stripe and I already checked the two thread I found here. Everything is working but the webhook. Any help? TIA
3 Replies
lee
lee•16mo ago
The http endpoints are exposed at https://adjective-animal-number.convex.site (not .cloud) I think we can improve the docs on this, sorry about that
rdgr
rdgrOP•16mo ago
Thank you so much! That's really helpful 🙂 And I agree, the Deployment URL shows as .cloud and that's misleading. Appreciate the quick response.
fashionedsense!
fashionedsense!•13mo ago
This took me way longer to find that I would care to admit. Thank you.

Did you find this page helpful?