Publishing Your Site


Collapse Content

It's time to publish your site!

First, make sure to commit all your changes with git:

git add .
git commit -m "created controllers and views"

Next, push your code to Heroku:

git push heroku master

If you want the sample seed data on your live site, run:

heroku run rake db:seed

You can now share your live site with the world! If you want to change the name and URL of your app, you can run the following command in your terminal:

heroku rename your-new-app-name

Connecting Your Site with Cloudflare

Optional Section

If you're interested in running a live website with your own domain, it's a good idea to get Cloudflare for it.

Cloudflare provides a free service for speeding up your site and protecting it from certain kinds of attacks. It provides many other benefits, so it's worth connecting your production site to it.

Heroku lets you add custom domains, which you can do from within their settings. However, you can skip this step if you connect your site with Cloudflare and connect it with your regular Heroku address (your-name.herokuapp.com). This will also let you use free SSL encryption for your site.

Here are some very brief instructions for setting up Cloudflare with your site:

  1. If you haven't done so, buy your own domain name.
  2. Sign up for Cloudflare.
  3. Change your DNS settings in your domain provider to use Cloudflare's DNS.
  4. Click on Cloudflare's DNS settings. Create a new cname record and point www to your herokuapp domain. For example, if your app is named automatedstore, create this rule: >CNAME www is an alias of automatedstore.herokuapp.com
  5. Click on Page Rules in Cloudflare. Forward all visits to the root domain to www by creating the following pattern:
    > http://yoursite.com/* Forwarding to http://www.yoursite.com/$1
  6. To require HTTPS, you can create another rule for that purpose.

If you did everything right, you now have your own live domain with free SSL and Cloudflare services!

Challenge

Run rake test in your terminal.

Please sign in or sign up to submit answers.

Alternatively, you can try out Learneroo before signing up.

Contact Us
Sign in or email us at [email protected]