Skip to content

Instantly share code, notes, and snippets.

@patricktouchette
Created June 9, 2018 03:25
Show Gist options
  • Save patricktouchette/02fb9e761e0877e9bbc7805fb926f1e3 to your computer and use it in GitHub Desktop.
Save patricktouchette/02fb9e761e0877e9bbc7805fb926f1e3 to your computer and use it in GitHub Desktop.
Heroku Express Deploy Cheat Sheet.js
# Express App
- npm init
- npm install --save express ejs
- create .gitignore and add node_modules, .env
- create express app.js
- add start to package.json scripts object // "start": "node app.js"
#Environment variables
- npm install dotenv --save
- create a .env file
- add variables to the .env file. For example
PORT=3000
IP=0.0.0.0
DATABASEURL=mongodb://localhost/yelp_camp
# GIT
- git init or git clone repo
- git add .
- git commit -m "first commit"
# Heroku CLI
- heroku login
- Enter email
- Enter password
- heroku create example-83333 //or leave blank to get a generic name
- git remote -v //check remote
- git push heroku master
- heroku logs // to check if there were any errors when uploading
- heroku run ls //check the files on heroku
- heroku config:set DATABASEURL=mongodb://<dbuser>:<dbpassword>@ds249530.mlab.com...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment