Development Notes
For all things heroku, go Getting Started with Node on Heroku
Run heroku login
from cmd
(cant from bash)
Run heroku open
to get to landing page
Run heroku local -e .env.local
to run a local server on port 5000
Use touch .env.local
to create the file (if needed)
Run heroku open angular
to see that specific route
Read through app.js
to see all the node.js server routes
To push changes to the heroku server run git push heroku master
To push changes from a non-master branch, run git push heroku otherbranch:master
Make sure that the project is linked to the heroku remote repository with this command:
heroku git:remote -a <app-name>
Open add-ons with heroku addons:open papertrail
(or mongod
)
To edit configuration variables open .env.local
(or use cmd line)
Test the api locally or remotely using postman
Alternatively, test api using browser https://<app-name>.herokuapp.com/api/bears
Running Locally
Make sure you have Node.js and the Heroku CLI installed.
$ git clone [email protected]:heroku/node-js-getting-started.git # or clone your own fork
$ cd node-js-getting-started
$ npm install
$ npm start
Your app should now be running on localhost:5000.
Deploying to Heroku
$ heroku create
$ git push heroku master
$ heroku open
or
Documentation
For more information about using Node.js on Heroku, see these Dev Center articles: