Deploying ReactJS application in production (with nodeJS backend)

前端 未结 3 774
清酒与你
清酒与你 2021-02-11 05:28

our project is now over, we only have two weeks to give back the project for our final year\'s studies at University. Our teacher told us that now that development phase was ove

3条回答
  •  佛祖请我去吃肉
    2021-02-11 06:01

    In 2019 this does work for me:

    in node.js server:

    app.use('/react',   express.static(path.join(__dirname, '../client/build')));
    

    in package.json react

    http://localhost:server-port/client 
    

    and in browser just type

    http://localhost:server-port/client .
    

    You should see react homepage now. Hopefully helpful for somebody.

提交回复
热议问题