The hosting procedure

GetGoing: Introduction to Golang API hosting using heroku
4 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
This is a free item
$0.00
د.إ0.00
Kz0.00
ARS$0.00
A$0.00
৳0.00
Лв0.00
Bs0.00
B$0.00
P0.00
CA$0.00
CHF 0.00
CLP$0.00
CN¥0.00
COP$0.00
₡0.00
Kč0.00
DKK kr0.00
RD$0.00
DA0.00
E£0.00
ብር0.00
€0.00
FJ$0.00
£0.00
Q0.00
GY$0.00
HK$0.00
L0.00
Ft0.00
₪0.00
₹0.00
ISK kr0.00
¥0.00
KSh0.00
₩0.00
DH0.00
L0.00
ден0.00
MOP$0.00
MX$0.00
RM0.00
N$0.00
₦0.00
C$0.00
NOK kr0.00
रु0.00
NZ$0.00
S/0.00
K0.00
₱0.00
₨0.00
zł0.00
₲0.00
L0.00
QR0.00
SAR0.00
SEK kr0.00
S$0.00
฿0.00
₺0.00
$U0.00
R0.00
ZK0.00
Already have an account? Log In

Transcript

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.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.