Getting Url for a file in convex
When I try to send a request, it writes an error 404 Not found, I tried to find the answer in the documentation and the problem is that the file id that we have does not work to receive the link
here is the code in which I call the function:
id that I use and I have this
fileId
in the database14 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
have you defined an HTTP action
/getImage
? if so you want to use the HTTP action url, which ends in .convex.site, not the url that ends in .convex.cloudIs it possible to define 2 actions at once in
http.ts
? Now I have definitions there for authorization via clerkHTTP Actions | Convex Developer Hub
HTTP actions allow you to build an HTTP API right in Convex!
I tried it, still 404
yeah the problem is
and the urls that have .convex.cloud in them, when they should have .convex.site
https://docs.convex.dev/functions/http-actions
HTTP actions are exposed at https://<your deployment name>.convex.site (e.g. https://happy-animal-123.convex.site).
HTTP Actions | Convex Developer Hub
HTTP actions allow you to build an HTTP API right in Convex!
you can find your url at https://dashboard.convex.dev/deployment/settings
Convex Dashboard
Manage your Convex apps
It worked, thank you very much!
@lee But what if now when you click on a link or send a request, it says “No matching routes found”
hmm i'm not sure what's wrong. can you add a
console.log
in the http action and check convex dashbord logs to see if it's getting called? also make sure the file is convex/http.ts
and it does export default http;
at the bottomHTTP Actions | Convex Developer Hub
HTTP actions allow you to build an HTTP API right in Convex!
I accidentally deleted a piece of code from http.route /getImage 😅
thanks again