I have hosted my group project on vercel, and hope to use it in my portfolio. However, there is something weird going on and I am not sure why. After it successfully hosted, I tried it and made sure everything ran like it should and it did. I closed that window, and came back to it, but when I load the page and try logging in nothing works. I checked the dev tools and I see this in the console.
I tried searching it, but there were numerous reasons why this could be happening and no real solution. I was wondering if anyone else has experienced this? Not sure why it would work originally, and now refuse the connection everytime.
This part of the project was set up by someone else. So, I am not sure of any of their reasoning behind the decisions. This would be the full page of the file if that helps any
That might have worked if you had the local server running when you were testing it. But that isn’t correct, the API needs to be running on some server anyone can access.
It’s a node/express API, the code must be somewhere in the codebase (same repo if monorepo, or using a different repo for the client and backend). How you set it up may depend on how the project is structured.
You can host the API on a separate server from the client code, like Heroku for the backend, and keep Vercel for the frontend. The express code can run anywhere that supports Node/Express apps (even Replit or Glitch)