Hi everyone, in this video, we're going to be deploying a service to the cloud. So you go to dub dub dub.heroku.com. And you download their Heroku CLA or the command line interface, then you simply do Heroku login. So it's going to ask for your ID and password. And then it's going to log in. So press any key to open up the browser, I'm going to do a queue right now, because I'm already logged in.
Now make sure that you have a git repository initialized in your project directory, so he's been doing it in it, you can do a git add, add all of your files to the get repo. And then you would work commit. So once you've done this, simply create a Heroku application you can go to create and the name of your application. So this is going to spin up an application for you. It's going to be totally free. And then if you go to the Heroku dashboard, and refresh you can see that we have a good way to do created right for us and you're gonna Go to Settings even go to deploy, and then you can also connect your GitHub to it.
And then after doing this, what you need to do is you need to create a mapping between our remote repository and the clouds remote repository. So basically, cloud also has a repository, which we push our code to, and then it triggers a bit. So to do that, you can simply do a Roku, get remote minus a and then the name of our application. So after this, whenever we do get push, Roku master is going to trigger a build. So we do a get, push, Heroku master. And then we wait for the push to happen.
So what this is doing right now is, this is sending all of our code to Heroku, the repository on Heroku. And then it's understanding our code. It's deciding which language it is. So in our case, it is Google and then it's looking at our dependencies. It's saying that okay, this project needs In these these things, are they in your mind, if there is, there are, the things are in my vendor, then it's going to pass in the port, or our program is going to take the port from the environment and it's going to launch. So you can see right here, our instance has successfully launched.
So to view our instance, we can do this, we're going to open up. Now you can see that in this case, the connection was refused. So why the connection was refused was because our SQL instance is not running on Heroku. So the thing is that Heroku also offers SQL plugins. So if you go to Heroku SQL You can also add plugins for SQL. So the only things that are that are going to changes in your model connect or go.
Just your route is going to change so your route so your route in this case will not be your local SQL instance. It will be the SQL instance hosted on the Heroku servers. So right now what we are doing is we are using my own SQL instance on my local machine, that won't be the case when you're deploying to the cloud. So apart from this route, if you go to get going to do dot Heroku app.com. And if you do a slash ping, then you can see that works. So this route is accessible from any machine, not just my machine.
Notice that when we are running our server, we have to use localhost. So in that case, we are very restrictive. So if you're working with a team of two, three developers, where one is making an interface in in the form of a mobile application, and the other person is being interface and form a web application, then it's better if you host your application in this way, spin up a Heroku login, and then add the link to the model. Simply push and it's going to spin up the instance. right for us to use. So thank you guys.
We successfully hosted our application in this video. See you guys in the next video.