0

There is a site with a client and a server part. The client part is hosted on Vercel, the server part on Railway. The client part makes requests to the server using Axios, Axios instance has baseUrl which is taken from .env file. The variable was specified in the settings when it was hosted on Vercel like that VITE_API_URL: link which generated Railway. Vite is used as the builder. The problem is that request to server Request URL looks like this [link that Vercel generates]/[variable that was specified in Vercel settings]. I have used Vercel, Surge, Render, Netlify and all platforms have this problem.

Instance of Axios: Instance of Axios

vercel.json file: Vercel.json

I expect the Request URL to look like this [variable that was specified in Vercel settings].

  • If all platforms 'have this problem', then it is most likely related to your own setup or code. It is impossible to debug or answer the question with the information provided. Please check https://stackoverflow.com/help/minimal-reproducible-example – paulogdm May 17 '23 at 11:39

1 Answers1

0

You must have entered the url in your .env file without mentioning https://

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 15 '23 at 14:42
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/34822805) – Ram Chander Aug 16 '23 at 09:46