Hi guys, this is a way to run the react and express in a single server and a static way
- Create a react project and write your code.
- Create an express project.
- Run the express project.
- Link the express backend with react and build.
- Set the react project build folder as static in the express.
- And re-run the express project.
app.use(express.static(path.join(__dirname, 'build')))
working
The react project will be bundled together through the build. And it will contain an HTML file so the HTML file will be rendered when the express project run. So the HTML file will available for the end user and
Top comments (2)
This site gives us many information to solve error form our site! Thanks buddy to share this great amazing information! dua for something you really want
Really nice