Tuesday 30 April 2019

How do I deploy this app to Heroku?

I created this ( https://github.com/amirsaranBIH/calendar-app ) app with React for the client and Express for server/api. I want to deploy it to Heroku. I have to start two different servers (React client server on port 3000 and Express api server on port 3001) with my npm start script. It looks like this: "concurrently \"cd api && node bin/www\" \"cd client && npm start\"". It works fine on my localhost when I run it.What do I need to change and/or add or configure.Will Heroku use the ports that I set up. For example: axios.post('https://react-nodejs-calendar-app.herokuapp.com:3001/api/test', data). Will this still work?I also set up a proxy in the client package.json ("proxy": "http://localhost:3001"), will I have to change the host or it will ignore the proxy (it's only for development from my understanding, I only included that because I followed a tutorial).If you need more information I can provide.Detailed explanations are welcome, I want to learn this, not just follow a tutorial.

Submitted April 30, 2019 at 01:47PM by AmirSaran

No comments:

Post a Comment