1
00:00:08,370 --> 00:00:09,510
In this video.

2
00:00:09,510 --> 00:00:13,670
Let's go ahead and start to create our expert server.

3
00:00:13,830 --> 00:00:18,300
Because of that, we need to install the express package.

4
00:00:18,300 --> 00:00:25,350
So inside our terminal, let's go ahead and then install the package by using NPM.

5
00:00:25,350 --> 00:00:34,590
I express and for this, make sure that you install the exact version as I'm going to install.

6
00:00:34,620 --> 00:00:42,330
And that way after some days or months or years, if there are some big changes in the express package,

7
00:00:42,330 --> 00:00:45,000
your code and mine will be the same.

8
00:00:45,120 --> 00:00:47,520
So let's go ahead and install the version.

9
00:00:47,520 --> 00:00:50,010
4.1, 8.1.

10
00:00:50,010 --> 00:00:57,690
Let's hit enter and now let's wait for express to finish installing and attach finished installing.

11
00:00:57,690 --> 00:01:01,410
So let's go ahead and then start to create our server.

12
00:01:01,440 --> 00:01:03,180
So this is a file.

13
00:01:03,180 --> 00:01:12,270
So here let's go ahead and then require the express package as we installed X first.

14
00:01:12,600 --> 00:01:20,940
And then after that let's go ahead and create instance of express as app equal to express.

15
00:01:21,390 --> 00:01:24,720
And here is going to be our metaverse.

16
00:01:25,140 --> 00:01:32,430
And after that we are going to have our root and after root we are going to have our error handlers

17
00:01:32,430 --> 00:01:35,280
middleware down here as that.

18
00:01:35,550 --> 00:01:42,240
And then lastly, we are going to listen to our server, listen to server.

19
00:01:42,240 --> 00:01:45,360
So let's pull up this comment step by step.

20
00:01:45,360 --> 00:01:48,210
Let's start with the let's say to the server.

21
00:01:48,210 --> 00:01:57,390
So first let's create a port that we are going to use going to be process dot E and V dot port.

22
00:01:58,080 --> 00:02:05,010
And if there is no value on the port, then we are going to use our custom port as 9000.

23
00:02:05,310 --> 00:02:11,940
We can use any port of your choice, but make sure that this port is going to be used by different application.

24
00:02:12,060 --> 00:02:20,790
So lastly, let's go ahead and then listen to our server by using the port and comma our callback function.

25
00:02:20,790 --> 00:02:26,370
I'm going to use console that plug because console plug is also a function.

26
00:02:26,370 --> 00:02:35,720
So here I will say that server is up and running on ports.

27
00:02:35,730 --> 00:02:39,540
Let's inject the dynamic value as that.

28
00:02:39,630 --> 00:02:44,550
So let's go ahead and then configure our package to JSON file.

29
00:02:44,580 --> 00:02:51,390
So here we are going to use Main at server JS and for the script you are going to use start.

30
00:02:51,390 --> 00:02:58,440
And for this we're going to use Node to start our server, going to be as Node and then the name of

31
00:02:58,440 --> 00:03:01,620
the file which is server dot G's.

32
00:03:01,980 --> 00:03:11,520
So next step is let's go ahead and then run our server by making use of NPM, run, start and there

33
00:03:11,520 --> 00:03:12,420
we go.

34
00:03:12,420 --> 00:03:15,600
Server is running on port 9000.

35
00:03:15,600 --> 00:03:16,410
Perfect.

36
00:03:16,410 --> 00:03:19,950
But I forgot one more for the core root.

37
00:03:19,950 --> 00:03:22,950
So here is our root folder.

38
00:03:22,980 --> 00:03:25,680
Now our folders are complete.

39
00:03:26,010 --> 00:03:30,900
All right, the next video, let's go ahead and then start to create some dummy route.

40
00:03:30,900 --> 00:03:38,280
And after that, we are going to refactor its use MVC design pattern and from there we integrate MongoDB

41
00:03:38,280 --> 00:03:39,120
into it.

42
00:03:39,120 --> 00:03:41,490
All right, so let's get working, guys.

