Sunday, April 28, 2019

Heroku


What is Heroku

  • Heroku is a cloud platform to host your applications
  • Heroku is one of the cloud platforms has been in development since June 2007
  • Heroku supports Java, Nodejs, Python, React Js, PHP & Clojure.

How to deploy your application in Heroku

  • First, you want to install Heroku in your ubuntu pc
    • Open your Terminal & type this codes
      • sudo add-apt-repository "deb https://cli-assets.heroku.com/branches/stable/apt ./"
      • curl -L https://cli-assets.heroku.com/apt/release.key | sudo apt-key add -
      • sudo apt-get update

      • sudo apt-get install heroku
    • Check your heroku version
      • heroku --version
  • Signup for Heroku
  • Signup for mLab
  • Now Add (specify the version of the node) to package.json
    •  "engines": {
          "node": "6.10.1"
       }
  • Add Procfile to root
    • web: node server.js
  • Add .gitignore file to root
    • /node_modules
      npm-debug.log
      .DS_Store
      /*.env
  • Change Port  on server.js
    • const port = process.env.PORT || 8000;
  • Build and run locally
    • npm install
    • heroku local web
  • Deploy your application to Heroku
    • git init
    • git add .
    • git commit -m "first commit"
    • git status
    • heroku login
  • Enter your Heroku credentials.
  • heroku create Your application name
  • git push heroku master
  • Optional  (if above fails)- Add heroku git remote
    • heroku git:remote -a yourapp
  • And retry git push heroku master

1 comment:

  1. Lucky Club Casino site review (2021) - Lucky Club Live
    Lucky Club Casino · Betfair · Vip Gaming · Bet365 · Jackpot City Casino · Vip Gaming · Betfair · Betway 카지노사이트luckclub Casino · Vipgaming

    ReplyDelete