I want to serve build files of my react app on my other express application. So I copied all the static files inside build folder to public folder inside my express application and I used.
app.use(express.static(path.join(__dirname, './public')));
app.get("/",(req,res)=>{
res.send()}
)
app.get("/differentRoute",(req,res)=>{
res.send()}
)
app.listen(4000)
When I make a get request on http://localhost:4000/ my react page loads perfectly, however when I make the same request on http://localhost:4000/differentRoute, nothing loads, can someone explain me how it works?