1
00:00:00,330 --> 00:00:07,680
And once our basic express server is up and running next, I want to connect to our database and if

2
00:00:07,680 --> 00:00:13,180
you remember, we just need to navigate through the Atlas and then we're looking for Connect.

3
00:00:13,590 --> 00:00:16,290
So that is going to give us that connection string.

4
00:00:16,560 --> 00:00:20,190
And, of course, we'll have to supply here the proper values.

5
00:00:20,550 --> 00:00:26,760
So let me just grab this one, then we're going to navigate back to our project and of course, all

6
00:00:26,780 --> 00:00:29,240
right away set it up in data entry.

7
00:00:29,580 --> 00:00:32,790
So in the star, make sure it's in route.

8
00:00:33,120 --> 00:00:37,880
We're going to go with new file and then we go with dot envy here.

9
00:00:38,250 --> 00:00:42,960
And then once we have the file, then, of course, we want to create a new variable.

10
00:00:43,200 --> 00:00:48,980
And since that is a common practice to call this model, your eye will do the same where we'll say Mongo

11
00:00:49,030 --> 00:00:53,320
underscore Urara is equal and of course, we copy and paste.

12
00:00:53,820 --> 00:00:59,430
Now, as far as the database, I'm going to call my one zero four and then store API.

13
00:01:00,380 --> 00:01:06,500
Essentially the same as the project name, but sky's the limit, you can choose a different name, of

14
00:01:06,500 --> 00:01:08,260
course, as well as mine.

15
00:01:08,300 --> 00:01:13,260
As far as the password, since I changed from my silly one, two, three, four.

16
00:01:13,670 --> 00:01:17,770
Now, of course, I'll freeze the video so you don't see what is my real password.

17
00:01:18,050 --> 00:01:23,600
And then once you add your own password, then make sure that you save data entry.

18
00:01:23,870 --> 00:01:24,980
That's a must.

19
00:01:25,730 --> 00:01:27,140
We want to restart the server.

20
00:01:27,470 --> 00:01:30,150
So I'm like, I'll stop the server with control, see?

21
00:01:30,380 --> 00:01:37,520
And then again we go with ampm start and then once everything is in place now of course we just need

22
00:01:37,520 --> 00:01:45,410
to go back to app just and I just want to showcase that of course the function is already there, so

23
00:01:45,410 --> 00:01:49,390
the only thing you'll need to do is just to invoke it in.

24
00:01:49,630 --> 00:01:55,400
Yes, of course you need to require it and then passing the connection string with proper values.

25
00:01:55,580 --> 00:02:01,790
And since we already covered all of this set up in the previous project, essentially there's really

26
00:02:01,790 --> 00:02:03,710
nothing new that we can learn over here.

27
00:02:04,010 --> 00:02:12,890
I already prepared all the code, so we simply need to grab this function and pass in the correct connection

28
00:02:12,890 --> 00:02:13,180
string.

29
00:02:13,400 --> 00:02:18,380
So let's go back to Objets and I guess we'll do that somewhere on top.

30
00:02:18,650 --> 00:02:25,370
So right after app, before the malware, we're just going to go with CONSED and again online with exactly

31
00:02:25,370 --> 00:02:25,850
the same.

32
00:02:25,850 --> 00:02:28,580
Cannot be not one is equal to require.

33
00:02:28,910 --> 00:02:34,750
We're looking in the database folder and then more specifically we're looking for connect.

34
00:02:35,180 --> 00:02:38,480
Now this function, of course, returns a promise.

35
00:02:38,810 --> 00:02:47,120
That's why we set up start with our sync and then right above the app that Eidelson is going to go with

36
00:02:47,120 --> 00:02:48,920
a White Connect DB.

37
00:02:49,130 --> 00:02:54,680
And then of course I'm looking for my variable, the one that's coming from the data entry.

38
00:02:55,010 --> 00:02:59,030
And I simply go here with process and then data entry.

39
00:02:59,210 --> 00:03:02,300
And then of course the variable name was Mongul.

40
00:03:02,510 --> 00:03:03,350
You are right.

41
00:03:03,620 --> 00:03:07,000
And if you see in a console server is listening on PT..

42
00:03:07,010 --> 00:03:12,080
Three thousand and of course we are in good shape and we can move on to our next task.

