BUG - Deploy Nuxtjs on AWS Amplify not conecting with Backend API, but works locally

32 views Asked by At

I have a project where the frontend was made in Nuxtjs and deployed on Amazon Amplify, the backend is in Django.

The backend works locally and online. The frontend only works locally connected to the back that is online, but after deploying the front to AWS amplify it cannot see the API and whenever it does a GET at login, for example, it does not work.

I think it's because it's done with SSR, because when I check the login get, a URL appears that is not the same as the one I have in the backend. When checking the project folders I see one called composables, which is where it calls folders, which look like the paths that return in the devtool on console, and these folders call another called server, which then has the connection of URLs with the correct environment variables.

I don't know what could it be, but it is very weird.

Just one observation, the websocket is working as well and configured in the environment variables, I had an issue on it but after change the variable it worked, so yah, the veriable is working, it is just comething that is not working properly and not getting the API in a correct way.

The backend guy said he's not good on frontend but he thinks it is related with SSR, but it is just a guess.

Can someone give me a hand here please?

Thanks

I tried on local and it is working with online backend. I tried change the API_BASE variable and it is not working :(

0

There are 0 answers