You are browsing as a guest. Sign up (or log in) to start making projects!

9h 23m 11s logged

Done and Dusted

Devlog #11

I’m finally done with this project (technically speaking). I hosted this project on Vercel which wasn’t as smooth as it should have been.

The Hosting Process

I ran into so many errors while hosting. WAY TOO MANY. Connecting my GitHub repository to Vercel was straightforward but everything else wasn’t at all. I first ran into build errors when pushing code to GitHub which would then get deployed to my Vercel project. If I remember correctly, the fix was to make sure Vercel tracked the correct root folder (my frontend folder in this case because that’s what it serves to the client side/frontend). After that, my website couldn’t access my Express backend. The fix to that was to have different URL fetch paths depending on whether I was running my code in my development environment or on Vercel. I believe I also had to change where my backend controller was mounted in Express (I had to add “/api” to the front of the path). My last issue was my static assets not loading while in production (they loaded just fine in development). The solution was found in my vercel.json file. I originally had a global catch all path that Vercel used to catch all frontend requests. This global path, however, caught requests that asked for my static assets, thereby not letting them appear on the frontend. Removing the global path and only having my backend redirect path solved this issue.

That’s it! I will ship this project as soon as I get more questions into FRC Trivia!

0
6

Comments 0

No comments yet. Be the first!