Back

Issue calling functions from vercel

  • 0
  • Functions
  • Web
  • Cloud
gaurav77
18 Oct, 2024, 14:49

I have created a express API function. I was facing issue calling the function directly via its apprwrite URL on local env so I tried adding a proxy this worked on local env, but when deployed the code on vercel. I faced error: POST https://canteen-management-two.vercel.app/chat/user/yashTest 404 (Not Found). I am even using AppExpress CORS Middleware but still facing such issue. Also added localhost, *.vercel.app as hostname as Platforms to my project. FYI: I am to hit this endpoint using apprwrite's function URL via postman.

@darShan Can you help me with this? Attached images of code. Please let me know if any more info is required.

TL;DR
Developers are facing issues calling functions from Vercel. The error they encountered was "POST https://canteen-management-two.vercel.app/chat/user/yashTest 404 (Not Found)" despite using proxies and CORS middleware. The problem might be related to the proxy configuration in Vercel. Make sure the domain is allowed to be used elsewhere. For local environment issues, try hitting the endpoint using the Appwrite function URL via Postman.
darShan
18 Oct, 2024, 14:53

I don't think this is related to cors. How did you deploy your function at https://canteen-management-two.vercel.app? Does vercel allow using domain somewhere else?

darShan
18 Oct, 2024, 14:57

I see that the direct url hit works - https://66700e5aef9b29ddc13f.appwrite.global/, its probably something with the proxy config you've defined.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more