1
00:00:00,300 --> 00:00:01,330
Not bad, not bad.

2
00:00:01,620 --> 00:00:09,000
We have set up the connection we have refactor the code and we're almost, almost, almost ready to

3
00:00:09,000 --> 00:00:10,550
start tinkering with the data.

4
00:00:10,890 --> 00:00:16,890
But there's one last thing that I want to do first, and that is simply setting up of the dot.

5
00:00:16,900 --> 00:00:19,660
And we now why we would want to do that.

6
00:00:20,100 --> 00:00:21,270
Well, let's think about it.

7
00:00:21,570 --> 00:00:26,300
Eventually, we might push this up to get them correct.

8
00:00:26,730 --> 00:00:31,000
And what do you think is going to happen the moment I push this up to the get them?

9
00:00:31,340 --> 00:00:40,200
Of course, everyone who takes a look at my repo can nicely grab the string and tamper with my data

10
00:00:40,470 --> 00:00:41,850
and how we can avoid that.

11
00:00:41,880 --> 00:00:48,420
Well, the solution is to set up dot every file where we can keep our secret.

12
00:00:48,840 --> 00:00:56,830
And in our application, we'll have to use a package by the name of DOT N.V. and of course, I already

13
00:00:56,850 --> 00:01:03,540
install it for you and then we'll be able to access those secret variables anywhere in our application.

14
00:01:03,840 --> 00:01:10,650
And once we push this up to the get up, if we add get ignore so dot get ignore file.

15
00:01:10,890 --> 00:01:16,890
And then in here we specifically say which files we want to ignore and make sure that you add dot.

16
00:01:16,890 --> 00:01:22,830
And we know I also added modules because that is a common practice since that folder is so big.

17
00:01:23,100 --> 00:01:31,770
But as far as keeping secrets secrets, make sure that not only you set up DOT EMV and of course use

18
00:01:31,770 --> 00:01:34,620
the package because otherwise you won't be able to access the variables.

19
00:01:34,920 --> 00:01:37,050
But always, always, always.

20
00:01:37,050 --> 00:01:44,250
The moment you set up DOT and we also set up DOT get ignored and now we will just push this up to the

21
00:01:44,250 --> 00:01:47,100
get up and then dot and we will be ignored.

22
00:01:47,310 --> 00:01:53,780
So when people come see your report, they won't see this secret connection string.

23
00:01:54,210 --> 00:01:56,880
So let's start here by creating dot entry.

24
00:01:57,210 --> 00:01:59,840
And in my case, I'm going to do that in route.

25
00:02:00,210 --> 00:02:02,420
So I also suggest you do the same.

26
00:02:02,760 --> 00:02:04,290
So I'm going to go to the Star.

27
00:02:04,440 --> 00:02:12,140
I'm looking for new file and I'm going to go DOT and then N.V. and in here we have again key value pairs.

28
00:02:12,150 --> 00:02:14,340
However, we don't need to use the quotation marks.

29
00:02:14,820 --> 00:02:19,520
And I think I'm going to go with Mongo and you are right in this case.

30
00:02:19,740 --> 00:02:25,850
So I'm not going to go with long line connection string and then you simply want to think of this value.

31
00:02:26,220 --> 00:02:35,280
So cut it out from the can I just go back to DOT and we set it equal to my Mongul you I and then when

32
00:02:35,290 --> 00:02:37,950
I have an address I can simply removed.

33
00:02:38,340 --> 00:02:44,640
And then remember when we were setting up the function, I said that I'm going to be looking for the

34
00:02:44,640 --> 00:02:45,120
parameter.

35
00:02:45,120 --> 00:02:47,410
But of course initially we were not using it.

36
00:02:47,700 --> 00:02:49,170
Now of course, I want to use it.

37
00:02:49,530 --> 00:02:56,430
So I'll remove the hardcoded connection string and I'll say you are and we'll just save.

38
00:02:56,610 --> 00:03:02,250
Now, there's going to be another story because of course, we're not passing that connection string.

39
00:03:02,790 --> 00:03:06,630
So here we have the parameter, blah, blah, blah is undefined.

40
00:03:06,930 --> 00:03:08,580
OK, that was expected.

41
00:03:08,940 --> 00:03:17,640
Now what we want to do is go to the app Jass, since over here we invoke start and then we want to pass

42
00:03:17,640 --> 00:03:22,460
in that value from the data entry into the Connect DB.

43
00:03:22,920 --> 00:03:29,360
And in order for us to access those secret variables, we simply need to require that package.

44
00:03:29,760 --> 00:03:36,630
So I'm going to go below Curnock DB and we'll just say require and notice how we don't have to assign

45
00:03:36,630 --> 00:03:37,920
it to any kind of variable.

46
00:03:38,130 --> 00:03:41,190
We just go with data entry and that's the package name.

47
00:03:41,430 --> 00:03:47,120
And as a side note, if you want to install it, you just go with NPM install and then the package name

48
00:03:47,550 --> 00:03:56,430
DOT can be pretty self-explanatory and then you want to use process that envy and then whatever is the

49
00:03:56,430 --> 00:03:57,080
variable name.

50
00:03:57,240 --> 00:04:04,530
So let me save my data entry and then back in the objets once we require, we just want to go with dot

51
00:04:04,530 --> 00:04:05,400
and config.

52
00:04:05,880 --> 00:04:08,680
So essentially we just want to invoke the config.

53
00:04:08,940 --> 00:04:16,860
So now if we keep on scrolling where we have the Connect DB, we want to go with process data entry.

54
00:04:17,100 --> 00:04:19,529
And remember, that was one of those global variables.

55
00:04:19,829 --> 00:04:27,030
We go with dot envy and then we go Mongul or whatever the name for your variable is.

56
00:04:27,270 --> 00:04:30,980
My guess that is Mongul, you are and will save it.

57
00:04:31,140 --> 00:04:37,410
And of course we're back in business because I have server is listening on post three thousand again

58
00:04:37,410 --> 00:04:38,700
very, very important.

59
00:04:39,060 --> 00:04:46,800
If you want to keep your secret variables actually secret, set up the data and we get the package and

60
00:04:46,800 --> 00:04:53,610
you'll be able to access them anywhere in your application by using process that EMV and then whatever

61
00:04:53,920 --> 00:04:55,560
is the name of the variable.

