# Finally, off to production! 🚀

## Make a public React app! <a href="#gjor-nettsiden-din-offentlig" id="gjor-nettsiden-din-offentlig"></a>

For now, we have worked in CodeSandbox. But, wouldn't it be great fun to make it public? Nothing like showing off to your family and friends!

### Add version control <a href="#sett-opp-versjonskontroll-pa-koden" id="sett-opp-versjonskontroll-pa-koden"></a>

[Git](https://git-scm.com/) is todays standard for version control. Version control is not only good for finding back to the ancient times of code, but is also actively used when developing in team.&#x20;

Head over to Facebook's Github-page for setting up your own repo with: [Create React App](https://github.com/facebook/create-react-app). We find this pretty straight-forward to use if you just follow the instructions :)&#x20;

### Publish your repo at Heroku <a href="#publiser-koden-pa-heroku" id="publiser-koden-pa-heroku"></a>

Create a user at [Heroku](https://heroku.com/). Heroku is a easy-to-use cloud service, letting you publish your code automatically through automatic integration with Github.&#x20;

> There are many other cloud services like Heroku out there; the most notable ones being AWS, Google Cloud og Azure. When it comes to small spare-time projects, Heroku and [Firebase](https://firebase.google.com/) are two good and easy-to-use services.&#x20;
>
> **Beware!** Some of the services offered by these sites, including Firebase, are paid services. Most of the time, this is not necessary at all.

**1. Create a new Heroku app**

In the right corner at Heroku, click the "New" button, and choose "Create new app". Choose a vacant site name.

**2. Connect you app to Heroku**

Go to the "Deploy" tab at the Heroku website, if you're not there already. As you can see, there a multiple ways to setup the deployment. Choose the Github integration and follow the instructions. Heroku will need access to the repositories connected to your Github account - if you feel uncomfortable with this, don't do it :)&#x20;

Inside Heroku, we recommend using Automatic Deploys. This way, your site will always be updated at your Heroku app updates every time new code finds its way to the `master`-branch.

If you encounter the following error message while deploying:&#x20;

```
! No default language could be detected for this app.
HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
See https://devcenter.heroku.com/articles/buildpacks
! Push failed
```

...please add `Node` as buildpack under the app settings, and you *should* be ready to go!

Really, there's not much more to it than that. Congratulations, you have set your app into production with automatic deploys! 🎉

**Bonus: setup a custom domain**

If you own a domain, you can click your way into the Settings tab inside Heroku and add a custom domain. You will also need to setup a pointer back to your Heroku instance at your DNS provider. Typically, you set `CNAME` or `ALIAS`For this part, Heroku supplies a pretty good guide here on how to connect your app to your own domain: <https://devcenter.heroku.com/>.
