简体   繁体   中英

Deploy Nodejs + ReactJs to Heroku

I'm learning how to deploy a web site to heroku. My web app has a nodejs project and one mysql in the server side, a reactjs in the client side. Can you show me the steps that I need to do? Because I'm new to this. Thank you very much

Here is a step by step guide.

Put your app aside for a few moments and follow these:

  • To learn how to deploy a nodejs

https://devcenter.heroku.com/articles/deploying-nodejs

  • Now learning how to add a mysql database

https://devcenter.heroku.com/articles/cleardb#provisioning-the-shared-mysql-add-on

  • This will teach you how to deploy a 'raw' react app

https://blog.heroku.com/deploying-react-with-zero-configuration

Now, it's all about how you want things to be. You can have a route on your nodejs app that serves the index.html with the react app or a separate app for nodejs and for react. You should probably make them separated, just to keep things organized, but since it's your first deploy and you're probably using it as a hobby or to learn, any way is correct as long as you get it to work. Then you can build on top of that, split the apps into two, or maybe host the react app on aws s3. Who knows?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM