Friday, 28 April 2017

How to run a Node.js server script on Heroku and access it from angular4 app?

I've successfully deployed my angular4 application which has a node server script at the root directory of my angular4 app. Basically in order to run the script at Heroku, I added a this code "server": "node server.js", to package.js and use heroku run npm run server to run the command. Everything works fine, and server is started, but when I try to access it using heroku provided domain name like myapp222333.herokuapp.com:3000/api, the routes are empty and my angular app also cannot get any info from the routes specified on server script. Everything works fine at the local machine. What I am doing wrong ?



via d123546

No comments:

Post a Comment