1 00:00:00,180 --> 00:00:07,200 In this lesson you're going to learn how to set up custom environment variables for your node j s applications. 2 00:00:07,200 --> 00:00:14,940 Now our application is actually already using an environment variable inside of index dot J S we access 3 00:00:14,940 --> 00:00:17,040 process dot e envy. 4 00:00:17,040 --> 00:00:23,460 This is where environment variables are stored and we access the port environment variable which is 5 00:00:23,460 --> 00:00:25,220 provided by Heroku. 6 00:00:25,320 --> 00:00:31,710 When Heroku runs our node application what we're going to focus on in this video is providing environment 7 00:00:31,710 --> 00:00:34,180 variables to our node application. 8 00:00:34,260 --> 00:00:40,950 But when it runs locally on our machine now there are two major reasons why using environment variables 9 00:00:40,980 --> 00:00:42,440 is super important. 10 00:00:42,450 --> 00:00:47,730 The first has to do with security and the second has to do with customize ability. 11 00:00:47,730 --> 00:00:51,300 Well let's get started by talking about customization and to do that. 12 00:00:51,330 --> 00:00:56,530 We're going to open up Mongoose and J.S. in the DB directory inside of here. 13 00:00:56,550 --> 00:01:01,080 We have our database you are all hard coded into the application. 14 00:01:01,110 --> 00:01:06,270 That means when we run the app locally it connects to our local database and so far that's been going 15 00:01:06,270 --> 00:01:12,840 really well but it also means that when we deploy to Heroku it's still going to try to connect to our 16 00:01:12,840 --> 00:01:17,660 local database which is not going to exist when we deploy to Heroku. 17 00:01:17,670 --> 00:01:24,480 We'll be using another service to set up a professional Mongo DB database and we'll be using that connection 18 00:01:24,480 --> 00:01:26,180 string on production. 19 00:01:26,250 --> 00:01:32,220 So we have one value we want to provide when running and development and another value we want to provide 20 00:01:32,220 --> 00:01:34,090 when running in production. 21 00:01:34,120 --> 00:01:39,990 The answer is to set up an environment variable and provide different values for it when running and 22 00:01:39,990 --> 00:01:41,700 development and production. 23 00:01:41,700 --> 00:01:47,360 So without environment variables we would have no way to customize the connection string we're passing 24 00:01:47,430 --> 00:01:53,250 to the Connect method based off of the environment we're running in where we have Dev locally on our 25 00:01:53,250 --> 00:01:57,650 machine and proud or production on the Heroku servers. 26 00:01:57,690 --> 00:02:03,570 Now when it comes to security we also get a lot of advantages when using environment variables. 27 00:02:03,570 --> 00:02:09,870 So as an example right now we have a lot of important information hardcoded into our application such 28 00:02:09,870 --> 00:02:12,910 as the API key for setting a grid over an account. 29 00:02:12,910 --> 00:02:19,680 Dot J S now if we were to leave this right here in the javascript file we would eventually commit this 30 00:02:19,680 --> 00:02:23,560 to get push it up to get hub and push it up to Heroku. 31 00:02:23,640 --> 00:02:29,880 Now if everything goes well this API key won't fall into the wrong hands but merely by adding it to 32 00:02:29,880 --> 00:02:36,900 our code we are increasing the chances that at some point either now or in the future someone gets access 33 00:02:36,960 --> 00:02:37,860 to it. 34 00:02:37,860 --> 00:02:43,020 So let me give you an example my friend just started to learn how to write software and this is a true 35 00:02:43,020 --> 00:02:43,740 story. 36 00:02:43,770 --> 00:02:47,130 Now we create a discord server for me and my friend group. 37 00:02:47,140 --> 00:02:52,410 It's a little group chat and he was creating a chat bot for that as one of the first real projects he 38 00:02:52,410 --> 00:02:54,730 built with node and JavaScript. 39 00:02:54,750 --> 00:03:00,390 Now he created the application by getting an API key from our Dischord chat and using it to build the 40 00:03:00,390 --> 00:03:01,150 bot. 41 00:03:01,230 --> 00:03:07,110 So he built the bot with a private get Hub Repository and then he wanted to share it with the world. 42 00:03:07,170 --> 00:03:09,600 So he went ahead and made that repo public. 43 00:03:09,600 --> 00:03:14,280 Now before he did he removed the key switching to environment variables. 44 00:03:14,280 --> 00:03:19,610 He committed that and he pushed it up thinking he was safe when he made the repo public though you've 45 00:03:19,610 --> 00:03:21,860 got to remember that old commit history. 46 00:03:21,870 --> 00:03:24,400 It's still there and it's still contained. 47 00:03:24,420 --> 00:03:31,770 The discord API key someone somewhere wrote a bot that scrapes them and they held our discord chat ransom 48 00:03:31,800 --> 00:03:34,290 asking for one hundred bitcoins. 49 00:03:34,290 --> 00:03:36,350 Now obviously we didn't pay that. 50 00:03:36,420 --> 00:03:43,780 We just went ahead and created a new chat from scratch and we took security a bit more seriously. 51 00:03:43,830 --> 00:03:51,480 So when we have api keys in our code it's not necessarily dangerous but it leaves us open to more vulnerabilities 52 00:03:51,510 --> 00:03:52,510 in the future. 53 00:03:52,560 --> 00:03:58,890 So we're also going to break these out into environment variables and where those environment variables 54 00:03:58,890 --> 00:03:59,910 are defined. 55 00:03:59,940 --> 00:04:02,830 That's not going to get committed to the repository. 56 00:04:02,910 --> 00:04:06,660 So there's zero chance they ever fall into the wrong hands. 57 00:04:06,690 --> 00:04:11,610 Let's go ahead and figure out how we can get this done and we're going to start with the simplest example 58 00:04:11,610 --> 00:04:19,710 in index dot J s what we want to do is provide our own environment variable value for port when it runs 59 00:04:19,710 --> 00:04:21,340 locally on our machine. 60 00:04:21,480 --> 00:04:25,440 So we don't have to hard code the port three thousand right here. 61 00:04:25,440 --> 00:04:30,420 The first thing we're going to do is define that separate place for our environment variables and we're 62 00:04:30,420 --> 00:04:33,930 going to put that in a new directory in the task manager app. 63 00:04:34,020 --> 00:04:37,500 So right here we're going to create a config folder. 64 00:04:37,500 --> 00:04:44,430 Now the config folder and its contents are gonna be ignored by get using a dot get ignore file much 65 00:04:44,430 --> 00:04:51,080 like we did for the node modules directory when we created the web server app our weather application. 66 00:04:51,180 --> 00:04:56,820 So right here in the new config folder we're going to add a single file for the moment and we'll call 67 00:04:56,820 --> 00:04:59,080 it Dev dot EMV. 68 00:04:59,100 --> 00:05:05,270 So this is where we're going to provide the environment variables for that dev environment. 69 00:05:05,270 --> 00:05:10,000 And it is a file consisting of key value pairs one on each line. 70 00:05:10,010 --> 00:05:17,450 So right here I could have key equals value where I'm now creating a key environment variable with the 71 00:05:17,450 --> 00:05:21,030 value value in our case that's not what we want. 72 00:05:21,080 --> 00:05:23,460 We want to set a value for port. 73 00:05:23,540 --> 00:05:30,400 And I'm going to set it equal to the value three thousand which is what we're using locally in development. 74 00:05:30,440 --> 00:05:36,830 Now it's important to make sure not to add any extra formatting including spaces in between the various 75 00:05:36,830 --> 00:05:42,000 characters as that is going to affect how the environment variables are set. 76 00:05:42,050 --> 00:05:46,280 You want in your file to look exactly like this one now from here. 77 00:05:46,280 --> 00:05:49,360 That means we won't need to have three thousand right here. 78 00:05:49,370 --> 00:05:54,500 We can remove it in the port environment variable is already provided by Heroku. 79 00:05:54,500 --> 00:06:00,080 We've seen that and now our application locally is going to provide that as well. 80 00:06:00,080 --> 00:06:01,400 Now currently it doesn't. 81 00:06:01,400 --> 00:06:08,090 We have the environment file created but down below we can see that we're getting undefined as the value 82 00:06:08,120 --> 00:06:10,890 for the port from our message right here. 83 00:06:10,910 --> 00:06:12,460 Let's go ahead and adjust that. 84 00:06:12,560 --> 00:06:20,470 But actually using that Dev dot EMV file to populate the environment variables for our node application 85 00:06:20,600 --> 00:06:26,390 now setting environment variables is typically a huge pain because each operating system has a different 86 00:06:26,390 --> 00:06:27,850 way to get that done. 87 00:06:27,920 --> 00:06:33,680 We're going to use an NPM module though that allows us to get this done in a cross OS compatible way 88 00:06:33,950 --> 00:06:39,130 which means your project will work on Windows Mac Linux and Linux distributions. 89 00:06:39,160 --> 00:06:47,270 The module we're going to be using we can find over in the browser by googling NPM space EMV hyphen 90 00:06:47,360 --> 00:06:48,760 S.M. D. 91 00:06:48,890 --> 00:06:56,150 This NPM module is going to load in the environment variables we defined in that EMV file and then it's 92 00:06:56,150 --> 00:07:01,880 going to make sure they're available to our node j s application and we're going to go ahead and set 93 00:07:01,880 --> 00:07:03,830 this up in our project. 94 00:07:03,830 --> 00:07:10,700 So over inside a visual studio code we want to install this module down below I'll use control C to 95 00:07:10,700 --> 00:07:20,090 shut down node man followed by npm install the module is EMV hyphen it CMG at eight point zero point 96 00:07:20,090 --> 00:07:25,700 two and this is a module we only need it locally on our machine it's not something we're going to need 97 00:07:25,700 --> 00:07:33,550 on Heroku so we can use these save Dev flag like we did when we installed node on several sections a 98 00:07:33,560 --> 00:07:39,560 go what I'm going to do is go ahead and run that installation command and then we're gonna head over 99 00:07:39,560 --> 00:07:47,960 to package dot Jason as using this module requires us to make a small change to our script so over here 100 00:07:47,990 --> 00:07:55,580 we have the Jason File and down below I can see that EMV BMD is installed as a dev dependency which 101 00:07:55,580 --> 00:08:04,850 is great up above it's now our job to tell EMV CMT to load in the environment variables and provide 102 00:08:04,850 --> 00:08:11,240 them to our project when using the dev script we're not going to do that for these start script as these 103 00:08:11,240 --> 00:08:17,570 start script is going to run on Heroku and we'll talk about how we set environment variables on Heroku 104 00:08:17,570 --> 00:08:23,710 in the next lesson for now all we need to do is make a small change to the Devon script we're gonna 105 00:08:23,750 --> 00:08:29,270 add some stuff right up front so we'll leave these same command we had before just adding a space and 106 00:08:29,270 --> 00:08:36,740 right here we're going to use EMV CMT as a command and that's provided by the tool we just installed 107 00:08:37,990 --> 00:08:42,870 the next thing we provide is the path to the environment variable file. 108 00:08:42,910 --> 00:08:44,080 We want to use. 109 00:08:44,230 --> 00:08:47,450 Now for us that is dot forward slash config. 110 00:08:48,590 --> 00:08:51,340 Forward slash Dev dot EMV. 111 00:08:51,350 --> 00:08:53,730 That is the file that we created. 112 00:08:53,870 --> 00:08:56,180 And with this in place we're now done. 113 00:08:56,690 --> 00:09:03,120 So now when we run the def command EMV CMT is going to grab all of those environment variables. 114 00:09:03,260 --> 00:09:08,840 Then it's going to continue to run the node application but it will provide those environment variables 115 00:09:08,870 --> 00:09:10,990 to the app as it's running. 116 00:09:11,150 --> 00:09:17,690 Now the end result is that I should no longer see undefined in the message server is up on port I should 117 00:09:17,690 --> 00:09:21,350 actually see the value I defined over here. 118 00:09:21,350 --> 00:09:26,330 Now let's switch things up and change this to three thousand and one so we can actually see the change 119 00:09:26,420 --> 00:09:27,480 down below. 120 00:09:27,500 --> 00:09:34,920 All I'm going to do is start up the app exactly like I've done dozens of times before NPM run Dev that's 121 00:09:34,920 --> 00:09:40,910 going to load in those environment variables provide them to the node process and down below we can 122 00:09:40,910 --> 00:09:44,210 see it's working as expected no demand is still running. 123 00:09:44,210 --> 00:09:50,660 We can see it's output right here and we do indeed have the environment variable value. 124 00:09:50,660 --> 00:09:58,600 Now if I were to change that value it's not going to automatically be detected EMV CND only runs once 125 00:09:58,610 --> 00:09:59,540 right away. 126 00:09:59,540 --> 00:10:04,670 Which means that we just need to restart our program whenever we change an environment variable. 127 00:10:04,730 --> 00:10:09,410 And the good news is that once they're set we're almost never gonna change them right here. 128 00:10:09,410 --> 00:10:16,280 I've tweaked it back to three thousand down below I'll use controls C to shut it down up and enter to 129 00:10:16,280 --> 00:10:22,130 rerun the last command and this time I would expect to see port three thousand showing up and that is 130 00:10:22,130 --> 00:10:24,010 exactly what I get. 131 00:10:24,020 --> 00:10:25,040 So there we go. 132 00:10:25,070 --> 00:10:30,950 That's how we can set environment variables for our application when we're just running locally on our 133 00:10:30,950 --> 00:10:31,970 machine. 134 00:10:31,970 --> 00:10:38,570 Now we're going to do the same thing for the Jason Webb token secret d send a grid API key and the Mongo 135 00:10:38,570 --> 00:10:40,580 D.B. connection string. 136 00:10:40,580 --> 00:10:45,230 Let's go ahead and work through one more together then there'll be a challenge for you to do a couple 137 00:10:45,230 --> 00:10:46,250 on your own. 138 00:10:46,280 --> 00:10:50,470 The one we're going to work through together is the send grid API key. 139 00:10:50,600 --> 00:10:55,100 So right here we have the API key hardcoded into the javascript file. 140 00:10:55,100 --> 00:10:56,770 That is not what we want. 141 00:10:56,810 --> 00:11:03,200 I'm going to copy that to the clipboard and we're going to remove this line entirely instead of getting 142 00:11:03,200 --> 00:11:09,680 the variable value from the variable we just had we will instead get it from an environment variable 143 00:11:10,040 --> 00:11:15,450 which means that right here we'll be accessing process dot EMV dot something. 144 00:11:15,500 --> 00:11:18,430 Now we can pick whatever name we would like for this one. 145 00:11:18,500 --> 00:11:25,910 Let's go ahead and use something specific like send grid underscore API underscore key. 146 00:11:25,910 --> 00:11:28,040 So a naming environment variables. 147 00:11:28,040 --> 00:11:33,380 It's common to use all uppercase and to separate the words with underscores. 148 00:11:33,380 --> 00:11:36,230 It's not required it's just a convention. 149 00:11:36,230 --> 00:11:39,500 You don't have to follow it but it's a good idea to. 150 00:11:39,500 --> 00:11:44,340 Now we are relying on this VI environment variable to exist it currently does not. 151 00:11:44,570 --> 00:11:51,380 Let's go ahead and save the program and fix that by defining it over in dev dot EMV right here on the 152 00:11:51,380 --> 00:12:00,260 next line that is send grid underscore API underscore key exactly like we defined it before and we're 153 00:12:00,260 --> 00:12:06,680 setting that equal to the value I copied to the clipboard making sure that those quotes are not included 154 00:12:06,770 --> 00:12:10,250 here we just have the API key itself. 155 00:12:10,250 --> 00:12:17,600 Now I can save all of the files and down below I can manually restart the server and the API key should 156 00:12:17,600 --> 00:12:21,910 still be set correctly and I should be able to still get emails. 157 00:12:21,920 --> 00:12:25,780 Let's go ahead and test that out over in post man. 158 00:12:25,790 --> 00:12:29,910 The last thing I did was delete the user a couple of videos ago. 159 00:12:29,930 --> 00:12:35,570 Let's go ahead and recreate them once again using an email that I actually have access to so we can 160 00:12:35,570 --> 00:12:38,660 make sure we get it in our inbox right here. 161 00:12:38,780 --> 00:12:43,270 I'll go ahead and send that off down below the new user is created. 162 00:12:43,370 --> 00:12:49,100 We can move over to Gmail and see what we get right over here in my inbox. 163 00:12:49,100 --> 00:12:50,330 I have nothing. 164 00:12:50,330 --> 00:12:56,080 Now as mentioned there's a decent chance these emails will end up in your spam folder until you configure 165 00:12:56,090 --> 00:12:57,230 the custom domain. 166 00:12:57,230 --> 00:12:57,950 And here it is. 167 00:12:57,980 --> 00:13:03,850 Thanks for joining in and I have my message showing up and this is the one from zero minutes ago. 168 00:13:03,860 --> 00:13:05,750 The one I just sent. 169 00:13:05,810 --> 00:13:11,720 So the good news here is that the API Key is still being set up correctly and we're still able to send 170 00:13:11,780 --> 00:13:15,080 emails even though it's defined over here. 171 00:13:15,080 --> 00:13:20,740 Now it's your challenge you're going to be doing something similar for the Jason web token secret and 172 00:13:20,750 --> 00:13:23,520 for the Mongo D.B. connection string. 173 00:13:23,600 --> 00:13:28,970 Down below I have a series of comments outlining what I'd like you to do right here what I'd like you 174 00:13:28,970 --> 00:13:35,440 to do is pull out the Jason web tokens secret and database you are all into environment variables defined 175 00:13:35,480 --> 00:13:38,660 in this file and there are a few steps for getting this done. 176 00:13:38,660 --> 00:13:43,070 First up create those two variables and set the values correctly. 177 00:13:43,070 --> 00:13:46,990 You can just copy the existing value for each write out of the code. 178 00:13:47,090 --> 00:13:52,440 Much like we copy to ah send grid API key from the code that was up above. 179 00:13:52,560 --> 00:13:57,930 Then you're going to set up the values in the development EMV file that we have created and worked with 180 00:13:58,020 --> 00:13:59,030 over here. 181 00:13:59,220 --> 00:14:06,000 And finally in the code you want to swap out those hardcoded values for references to environment variables 182 00:14:06,060 --> 00:14:09,990 just like we did right here on line three last up. 183 00:14:09,990 --> 00:14:11,190 Test your work. 184 00:14:11,190 --> 00:14:17,430 So if you're changing the JWT secret any database you are you could test both of those by creating a 185 00:14:17,430 --> 00:14:19,890 new user and getting their profile. 186 00:14:19,920 --> 00:14:25,560 If I'm able to get the profile that I know I can communicate with the database correctly and if my Jason 187 00:14:25,560 --> 00:14:31,950 web token works when I sign up and then use it I know that's set correctly as well. 188 00:14:31,950 --> 00:14:33,420 All right knock that out. 189 00:14:33,420 --> 00:14:36,380 Test your work when you're done come back and click play. 190 00:14:40,390 --> 00:14:41,230 How that go. 191 00:14:41,260 --> 00:14:44,320 Let's go ahead and kick things off with the Mongo D.B.. 192 00:14:44,320 --> 00:14:45,120 You are real. 193 00:14:45,130 --> 00:14:47,270 Then we'll do the JWT secret. 194 00:14:47,290 --> 00:14:51,570 So right here inside of Mongoose Jay asked we have the connection string. 195 00:14:51,760 --> 00:14:54,580 We want to use in our development environment. 196 00:14:54,580 --> 00:15:00,670 I'm going to copy that to the clipboard head over to Dev dot EMV and create the new environment variable 197 00:15:01,120 --> 00:15:03,630 that is Mongo D.B. underscore. 198 00:15:03,640 --> 00:15:08,530 You are all setting and equal to the value I just copy it to the clipboard. 199 00:15:08,590 --> 00:15:15,610 Next up inside a mongoose dot J S we're going to remove the hardcoded value and reference the environment 200 00:15:15,610 --> 00:15:17,240 variable instead. 201 00:15:17,320 --> 00:15:22,120 That's process dot EMV dot Mongo D.B. underscore. 202 00:15:22,120 --> 00:15:27,180 You are all matching up exactly with what we had sitting right over here. 203 00:15:27,190 --> 00:15:33,490 Now if I save the program you can see that things are crashing because there is no value provided yet. 204 00:15:33,550 --> 00:15:37,910 I have to restart the server for the new end variables to be picked up. 205 00:15:37,930 --> 00:15:40,490 We'll go ahead and do that in just a second. 206 00:15:40,510 --> 00:15:42,640 Let's go ahead and knock out the other one first. 207 00:15:42,640 --> 00:15:48,790 So over inside of the challenge comments we've taken care of Mongo D.B. for these three steps. 208 00:15:48,790 --> 00:15:52,540 Let's do the same thing for the JWT secret. 209 00:15:52,540 --> 00:15:55,200 Now we use that in a couple of different places. 210 00:15:55,210 --> 00:15:59,750 We use it once in our authentication middleware to verify the token. 211 00:15:59,770 --> 00:16:01,030 That's right here. 212 00:16:01,240 --> 00:16:07,750 And we use it again inside of the User model when the token is created over in that file down below 213 00:16:07,900 --> 00:16:10,270 we have the same value right here. 214 00:16:10,300 --> 00:16:14,250 So let's go ahead and work through this process over in dev dot EMV. 215 00:16:14,260 --> 00:16:21,040 I will create JWT underscore secret and we can pick whatever value we would like. 216 00:16:21,070 --> 00:16:25,210 This is a secret for my app. 217 00:16:25,210 --> 00:16:26,320 Perfect. 218 00:16:26,320 --> 00:16:32,110 Now all we're going to do is swap it out with the hardcoded values in those two locations. 219 00:16:32,110 --> 00:16:42,250 So right here for the user model we remove this string and we reference a process dot EMV dot JWT underscore 220 00:16:42,250 --> 00:16:48,970 secret we save the program and we do the exact same thing in the off file when we verify that token 221 00:16:49,030 --> 00:16:50,770 later on right here. 222 00:16:50,930 --> 00:16:56,670 A process dot EMV dot underscore JWT EMV. 223 00:16:56,800 --> 00:16:57,780 Perfect. 224 00:16:57,970 --> 00:17:02,430 Now that we have this in place what's that JWT secret. 225 00:17:02,440 --> 00:17:03,250 There we go. 226 00:17:03,250 --> 00:17:05,590 Sorry for misspeaking right there. 227 00:17:05,590 --> 00:17:06,940 Got a little ahead of myself. 228 00:17:07,540 --> 00:17:11,490 So now we are referencing the S.E.C. RTT. 229 00:17:11,560 --> 00:17:12,910 Just checking my spelling. 230 00:17:12,910 --> 00:17:15,960 Geez I'm really going crazy and everything is looking good. 231 00:17:15,970 --> 00:17:18,730 And now we can test the application out. 232 00:17:18,730 --> 00:17:23,770 So we're gonna make sure that we save all of the files I'm also going to remove these challenged comments 233 00:17:23,770 --> 00:17:26,720 as the last thing to do is to test our work. 234 00:17:27,040 --> 00:17:27,730 And down below. 235 00:17:27,730 --> 00:17:28,050 Yes. 236 00:17:28,060 --> 00:17:29,070 It's still failing. 237 00:17:29,080 --> 00:17:30,770 We restart the server. 238 00:17:30,820 --> 00:17:33,830 It picks up on the new in variables we created. 239 00:17:33,910 --> 00:17:37,680 And right here the server is now working which is a good first step. 240 00:17:37,990 --> 00:17:40,800 But we're gonna do from here is create another user. 241 00:17:40,870 --> 00:17:47,560 Then we're gonna go ahead and try to access their profile to test things out over inside of postmen. 242 00:17:47,560 --> 00:17:49,540 We have our create user request. 243 00:17:49,540 --> 00:17:52,150 Now this email is already registered. 244 00:17:52,150 --> 00:17:55,550 I could go ahead and choose to delete them or I could just switch it up. 245 00:17:55,630 --> 00:18:00,800 I'll go ahead and use Andrew 3 example dot com. 246 00:18:00,940 --> 00:18:06,030 I'll save that request and I'll also switch out my log and request to use the same email. 247 00:18:06,040 --> 00:18:09,250 So that works going forward though that steps not necessary. 248 00:18:10,370 --> 00:18:12,320 Now we're actually going to create that user. 249 00:18:12,350 --> 00:18:16,530 So let's go ahead and knock that out by firing off the create user request. 250 00:18:16,580 --> 00:18:19,700 They're showing up down below which is a good first step. 251 00:18:19,700 --> 00:18:24,250 Now let's go ahead and make sure we can fetch them using read a profile right here. 252 00:18:24,290 --> 00:18:27,870 I'll read my profile and it's showing up as expected. 253 00:18:27,920 --> 00:18:29,590 So this proves that everything is working. 254 00:18:29,600 --> 00:18:36,210 I'm able to communicate with the database and my J.W. ts are getting created and verified correctly. 255 00:18:36,290 --> 00:18:39,500 Now that we have this in place we're really only halfway done. 256 00:18:39,620 --> 00:18:42,920 We have these environment variables defined locally. 257 00:18:42,920 --> 00:18:48,950 But if we were to push the project to Heroku only this one would exist Heroku does not automatically 258 00:18:48,950 --> 00:18:51,260 set these in the next lesson. 259 00:18:51,290 --> 00:18:57,260 We're going to deploy this project to Heroku and we'll learn how to set environment variables for the 260 00:18:57,260 --> 00:18:59,270 Heroku app as well. 261 00:18:59,270 --> 00:19:02,050 Now we're also going to be able to do some other fun stuff. 262 00:19:02,120 --> 00:19:07,090 We'll figure out how to ignore the config file to make sure that stays out of our get repo. 263 00:19:07,100 --> 00:19:09,690 Let's go ahead and jump right in to the next one.