create-react-app package.json support proxy=localhost:3000
Production
// Have Node serve the files for our built React appapp.use(express.static(path.resolve(__dirname,'../client/build')));// Handle GET requests to /api routeapp.get("/api",(req,res)=>{res.json({message:"Hello from server!"});});// All other GET requests not handled before will return our React appapp.get('*',(req,res)=>{res.sendFile(path.resolve(__dirname,'../client/build','index.html'));});
I think it's better for deploy
Devlopment
create-react-app package.json support proxy=localhost:3000
Production
jsx
Great! In this case, I will need only Node server to run the application. Thank you for the comment!