1 00:00:00,680 --> 00:00:05,150 In the last section we finish up the first half of our first time deployment checklist. 2 00:00:05,260 --> 00:00:07,010 We created our Heroku account. 3 00:00:07,130 --> 00:00:12,790 We committed our code base code base to a good repository and then we installed the Heroku CLID. 4 00:00:13,070 --> 00:00:17,960 So at this point in time you should be able to flip over to your terminal and run the command Heroku 5 00:00:17,960 --> 00:00:23,720 dash fee and see some version information pop out again if you're seeing an error message change over 6 00:00:23,720 --> 00:00:25,050 to the human discussion boards. 7 00:00:25,070 --> 00:00:26,760 And let me help you fix this. 8 00:00:27,140 --> 00:00:29,570 OK so now we've got the Rocha's Seelye. 9 00:00:29,570 --> 00:00:32,200 We can use it to create a new app. 10 00:00:32,510 --> 00:00:37,160 Now let's first use it to create the app and we'll talk about exactly what this app thing is. 11 00:00:37,160 --> 00:00:44,350 So the command line we're first going to log into our instance of Heroku by running Heroku log in like 12 00:00:44,360 --> 00:00:49,840 so after you run that command you should be prompted to enter your Heroku credentials. 13 00:00:50,000 --> 00:00:55,310 And so this is the email and password that you just created your Hoku account with. 14 00:00:55,400 --> 00:00:59,940 I've already signed in to my local Heroku Seelye so I'm not going to go through that process. 15 00:01:00,050 --> 00:01:05,590 But if this is your first time using Heroku you definitely will want to next. 16 00:01:05,610 --> 00:01:12,890 We will use the command line to create our new app so we'll run the command Brochu create like. 17 00:01:13,420 --> 00:01:20,580 Now after just a second or two we're going to see some output that contains two separate links. 18 00:01:20,580 --> 00:01:26,070 The first link that we see on here is with the nav that are in the first link is the address that will 19 00:01:26,070 --> 00:01:29,970 navigate to whenever we want to visit our application inside the browser. 20 00:01:30,090 --> 00:01:34,430 And so inside of here you'll see some randomly generated name for our application. 21 00:01:34,470 --> 00:01:41,600 In my case I have ADD gyle by you 6 5 to 6 so you very likely will have some completely different string. 22 00:01:41,680 --> 00:01:46,170 This string right here identifies the name of your application to Heroku. 23 00:01:46,380 --> 00:01:49,110 The second link is the link that we really care about. 24 00:01:49,110 --> 00:01:54,160 In our case this second link right here is our deployment target. 25 00:01:54,180 --> 00:02:00,080 It is a good repository that we can push our local server to. 26 00:02:00,120 --> 00:02:04,220 So we already committed our codebase and last section right we installed it. 27 00:02:04,290 --> 00:02:09,890 We created a new get repository and we committed our entire codebase to that repository. 28 00:02:10,000 --> 00:02:16,720 We are now going to push that repository to this remote repository that is managed by Heroku. 29 00:02:16,950 --> 00:02:23,340 The instant we push our repository to this remote one Heroku will take that as a signal that it needs 30 00:02:23,340 --> 00:02:26,940 to deploy our application and started up automatically. 31 00:02:29,450 --> 00:02:35,270 So we're now going to move on to the second to last step where we deploy our app with get. 32 00:02:35,270 --> 00:02:41,930 First we're going to make sure that we set up a remote get repository using the second link right here. 33 00:02:41,990 --> 00:02:49,220 So I'm going to copy the entire link and then I'll press command C to copy the link then at my command 34 00:02:49,220 --> 00:02:56,260 line I will execute get remotes add Heroku and then I'll paste the link. 35 00:02:56,260 --> 00:03:02,840 This command right here says add a remote repository to our current repository to the one that we just 36 00:03:02,840 --> 00:03:05,210 created inside the server directory. 37 00:03:05,600 --> 00:03:10,360 We want to name that remote link or that remote repository as Heroku. 38 00:03:10,580 --> 00:03:14,170 And this is the address of that remote repository. 39 00:03:14,330 --> 00:03:20,200 So I'll run this command and you might see something that says her remote Heroku already exists. 40 00:03:20,210 --> 00:03:21,680 If you do that's totally fine. 41 00:03:23,430 --> 00:03:28,360 Otherwise you might not see any output at all if the command successfully ran. 42 00:03:28,420 --> 00:03:31,890 OK so now we can use this to actually deploy our application. 43 00:03:31,890 --> 00:03:38,970 We're going to run the command get push Heroku master. 44 00:03:39,350 --> 00:03:46,160 So this says take all the code that we have committed to our local repository and push the master branch 45 00:03:46,520 --> 00:03:51,450 to the Heroku repository which exists at this you are l over here. 46 00:03:51,620 --> 00:03:58,680 So I run this command and then the instant we do we should see a little bit of debug information pop 47 00:03:58,680 --> 00:03:59,320 up. 48 00:03:59,360 --> 00:04:04,610 And so all this remote stuff this remote message that you see right here is all feedback that is provided 49 00:04:04,610 --> 00:04:05,920 by Heroku directly. 50 00:04:06,010 --> 00:04:09,270 And so Heroku is going to attempt to build our application. 51 00:04:09,320 --> 00:04:14,210 It's going to automatically detect that we are making use of no G-S that's going to set a couple of 52 00:04:14,210 --> 00:04:16,010 different runtime flags. 53 00:04:16,430 --> 00:04:21,860 It's then going to install the versions of node NPM that we specified inside the package not just on 54 00:04:21,860 --> 00:04:22,790 file. 55 00:04:23,060 --> 00:04:28,910 It will then install all of our dependencies which are listed inside the package not just on file and 56 00:04:28,910 --> 00:04:31,640 then it's going to essentially finish up the deployment. 57 00:04:31,670 --> 00:04:36,500 And so hopefully going to see a message that says something like build succeeded. 58 00:04:36,500 --> 00:04:42,620 Now at the very end we should see some it says like verifying deployment done and then the final success 59 00:04:42,620 --> 00:04:48,390 message that says the repository was successfully push to this remote location. 60 00:04:48,820 --> 00:04:54,950 OK now I'm going to say right now that at this point hopefully everything works and the application 61 00:04:55,010 --> 00:04:56,230 should be working. 62 00:04:56,510 --> 00:05:02,130 However it's incredibly likely and very possible that you might have some small issue. 63 00:05:02,390 --> 00:05:06,570 So the first thing we're going to do is test out our application and see if it's working. 64 00:05:07,040 --> 00:05:09,980 When we test this out if it doesn't work that's totally fine. 65 00:05:09,980 --> 00:05:10,880 Do not panic. 66 00:05:10,940 --> 00:05:15,680 Keep watching this video and I'll show you exactly how you can debug what's going on and try to figure 67 00:05:15,680 --> 00:05:16,460 out a solution. 68 00:05:16,460 --> 00:05:17,250 OK. 69 00:05:17,840 --> 00:05:22,460 So the first thing we're going to do is test out our application and see whether or not it is working 70 00:05:22,460 --> 00:05:23,360 successfully. 71 00:05:23,750 --> 00:05:31,250 So at the command line we'll run the command Heroku open like so now when we run this command it will 72 00:05:31,310 --> 00:05:35,810 automatically launch a new browser window and navigate to our deployed project. 73 00:05:35,810 --> 00:05:43,380 So for me it automatically visits my remote deployment target of agile by you and I see the message. 74 00:05:43,490 --> 00:05:48,860 Hi there appear on the screen which is currently what we are sending back to anyone who makes a request 75 00:05:49,100 --> 00:05:51,520 to the route route of our express application. 76 00:05:51,540 --> 00:05:55,840 And so if you see this right here you see just like plain text that says Hi there. 77 00:05:56,030 --> 00:05:56,490 Awesome. 78 00:05:56,510 --> 00:05:57,350 That's fantastic. 79 00:05:57,350 --> 00:05:59,930 It means you successfully deployed the application. 80 00:05:59,930 --> 00:06:05,900 If you see some message that says like hey something went wrong here or some Heroku message that's totally 81 00:06:05,900 --> 00:06:06,310 fine. 82 00:06:06,320 --> 00:06:09,590 Again let's go through the steps to debug this. 83 00:06:09,620 --> 00:06:12,530 So if you saw any error message that's totally fine. 84 00:06:12,530 --> 00:06:17,770 Flip back over to your terminal and run the command Heroku logs. 85 00:06:17,840 --> 00:06:23,090 Now when you run this command Heroku will automatically give you some output that was generated by the 86 00:06:23,090 --> 00:06:24,570 deployment process. 87 00:06:24,650 --> 00:06:28,880 And so hopefully you will see some error message in here that might give you a little bit of insight 88 00:06:28,910 --> 00:06:32,630 into exactly what went wrong during the deployment. 89 00:06:32,630 --> 00:06:34,820 Do your best to try to figure out what's going wrong. 90 00:06:34,820 --> 00:06:39,650 Feel free to google for some more error message or some follow up or some help on troubleshooting. 91 00:06:39,650 --> 00:06:44,090 But of course if you're having any issue or you see any error message inside of here. 92 00:06:44,270 --> 00:06:48,170 Always feel free to post something inside the to me discussion boards. 93 00:06:48,200 --> 00:06:50,510 And again I'll do my best to help you out. 94 00:06:50,510 --> 00:06:55,430 Now I do have to say if you see an error message and you make a post over on the discussion boards asking 95 00:06:55,430 --> 00:07:02,630 for help please please please take a screenshot of the error message that you see and post it on to 96 00:07:02,630 --> 00:07:05,030 me so I can see exactly what's going wrong. 97 00:07:05,030 --> 00:07:09,540 If you don't if you just say Hey it don't work something's wrong I can't help you right. 98 00:07:09,560 --> 00:07:13,710 You got to tell me what's going wrong so please make sure you include a screenshot. 99 00:07:14,430 --> 00:07:15,750 OK so anyways. 100 00:07:16,250 --> 00:07:16,900 Hey. 101 00:07:17,050 --> 00:07:19,450 On the plus side you know something went wrong. 102 00:07:19,490 --> 00:07:25,490 OK that's fine we'll figure it out but if everything went according to plan we have now deployed our 103 00:07:25,790 --> 00:07:29,610 brand new brand spanking new Express application. 104 00:07:29,690 --> 00:07:34,550 You can now take the R L right here and you can share with all your friends and they will be able to 105 00:07:34,640 --> 00:07:38,910 see your application as it develops over time throughout this course. 106 00:07:38,960 --> 00:07:44,390 Now do keep in mind that we're only going to deploy the application at some very specific intervals 107 00:07:44,720 --> 00:07:49,430 when everything is kind of working and ready to be deployed so there might be some points in time at 108 00:07:49,430 --> 00:07:54,110 which it's not the best to like share with your friends because it might be broken but you know we'll 109 00:07:54,110 --> 00:07:55,740 work through it over time. 110 00:07:56,490 --> 00:07:58,070 OK so that's pretty much it. 111 00:07:58,310 --> 00:08:00,480 At this point we're going to end this video. 112 00:08:00,800 --> 00:08:05,760 We still have not gone through the process of doing subsequent deploys But after we make our next change 113 00:08:05,840 --> 00:08:11,390 our codebase we will do a second deployment and we'll talk about how we do another follow deploy. 114 00:08:11,660 --> 00:08:16,850 What I do want to tell you is that when you attempt to deploy our application again you do not need 115 00:08:16,850 --> 00:08:18,410 to create another application. 116 00:08:18,410 --> 00:08:18,850 OK. 117 00:08:18,920 --> 00:08:20,390 Make sure that's really clear. 118 00:08:20,390 --> 00:08:26,150 So if you want to redeploy the application or follow up a second time we'll go through the next batch 119 00:08:26,150 --> 00:08:29,040 of steps right here which will cover in a few short video. 120 00:08:29,420 --> 00:08:29,740 OK. 121 00:08:29,780 --> 00:08:30,470 That's pretty much it. 122 00:08:30,470 --> 00:08:35,250 Let's continue in the next section and start adding some additional features to our back and server. 123 00:08:35,270 --> 00:08:37,090 So I'll see you in just a second.