#Serving site to production environment, Axios `ERR_CONNECTION_REFUSED` errors!
15 messages ยท Page 1 of 1 (latest)
Am I not supposed to use localhost, but instead the IP of the machine? As this is extremely problematic for switching between dev and localhost if I don't understand this correctly ๐
do you have a separate Backend or you use /pages/api in NextJS?
Separate backend
can I write you a DM?
No, thanks. Here is fine :)
ok, sure, sorry
so on the localhost, it works and on production not ?
maybe it is a PORT problem
Ah I fixed it by making a function to get those URLs I'm using in requests like this:
So now it works - idfk why I was trying to use localhost or 127.0.0.1 in a production app - must be fucking friday end of week tiredness ๐คฃ
Thanks anyway @thorn crown ๐
you should use env vars to read the URLs conveniently