a year ago
I deployed an app to railway using docker.
I am using fiber golang on the backend and the frontend is a react app which is served by the backend.
The problem is that on my local system the hompage or index page is correctly served when hitting localhost:3000/, but on railway: servicename.up.railway.app/ is responding with a 404. I have correctly set the port variable because the other endpoints are working as intended.
Maybe someone here knows what could be the issue.
5 Replies
a year ago
Likely because you haven't instructed nixpacks (the default builder) to build your frontend, resulting in no built files so the 404 makes sense.
there are better ways to go about this than having the backend serve the frontend, or if you're set on having the backend serve the frontend we can work that out too.
hop in our discord server and open a #Help thread so we can chat about potential solutions!
a year ago
I will join the discord to work out a solution. But also in the meantime I will also read up on nixpacks and how to deploy using that solution. I deployed using a Dockerfile with the frontend already built just copying over the resulting files.
a year ago
Dockerfile is the way to go for this in my opinion, maybe you just got some paths wrong?
a year ago
That could also very well be.
a year ago
Hop on discord, open a help thread with your Dockerfile and we can try to help!