Coder Social home page Coder Social logo

learning_heroku's Introduction

wdi

Getting started with Heroku

This is a quick walkthrough of getting an existing local application up to heroku.

Things to make sure of before you start:

  1. You should have installed the heroku toolbelt and be logged in with your heroku credentials.
  2. Your project should be in an existing git repository

Creating your app:

Create the app on Heroku

heroku create

you can also name your heroku app by passing a name to the above command

heroku create my_boss_app

to ensure that your app was properly created, you can run the comman:

heroku open

this should open a webpage welcoming you to your new heroku site.

Push your up to heroku like you would a github repository

heroku created a git remote path when you created your new app, so now you can push your code up to heroku using git

git push heroku master

If you open your app again, it will bring you to your root page.

Setting up your database:

It is important to note that if your application uses a database, you're going to have to set up the database remotely. Heroku uses pg, so make sure that your application (or at least the production part of it) is configured to use a 'pg' database. You can change the database configureation in your config/database.yml file (if you're using rails), and you should make sure to add the 'pg' gem to your gemfile under the production group.

heroku has a console attached to it, so you can run most rake commands from the terminal attached to your heroku dyno by prepending the 'heroku run' to the command. In this fashion, we can set up our database by running our migrations on the terminal attached to heroku:

heroku run rake db:migrate

If you'd like to destroy your remote database, you can do:

heroku run rake db:drop

but beware, this is your PRODUCTION database. if your site has users, this will destroy all of their information!

There it is: your basic setup for a heroku application. The heroku docs are exelent, as are many of the docs for the addons you can get through heroku. Explore the addons available; they are extremely useful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.