Fullstack app - after deplyment there are routes that throw a 404 error

I deployed a full stack app, in local it’s working fine but in production there are routes where it throws a 404 error. I mean I can see home page fine and profile of the user, but when I try search bar, cart or create a course, it throws a 404 error.


repo: GitHub - dreyanfranco/online-store

Appreciate the help


These are the symptoms of not setting up rewrites correctly for static sites, you’ll need every request coming in to go through your client-side router first, so it can then dispatch the request to the appropriate page/component.

See https://docs.render.com/deploy-create-react-app#using-client-side-routing for more explanation.

If you’re not using a static site but a web service, you need to make sure that the routes you’ve set up are correct and that your client-side router is working properly. The principles of client-side routing remain the same.

Render Support, UTC+3


I’m using a web service. Locally all routes and working as they should

this is the index.js of the server, I dont think I’m missing anything here

const express = require(“express”)
const cookieParser = require(“cookie-parser”)
const cors = require(“cors”)
const path = require(“path”)
const cloudinary = require(“cloudinary”).v2

cloud_name: process.env.CLOUDINARY_CLOUD_NAME,
api_key: process.env.CLOUDINARY_API_KEY,
api_secret: process.env.CLOUDINARY_API_SECRET,

const app = express()
app.use(express.urlencoded({ extended: false }))

app.use(express.static(path.join(__dirname, “…/client/dist”)))


app.get(“*”, (req, res) => {
res.sendFile(path.join(__dirname, “…/client/dist/index.html”))

const PORT = 5005

app.listen(PORT, () => {
console.log(Server listening on http://localhost:${PORT})

module.exports = app


Could you provide more specific examples of which routes or what exactly is failing? When I browse your service, most routes seem to be working fine and most things aren’t showing errors. Your service seems generally available and healthy, so the issue is likely due to some configuration errors.

Render Support, UTC+3