1
00:00:00,330 --> 00:00:06,990
I've met and met our basic functionality seems to be working, so now we can continue and set up Basic

2
00:00:07,260 --> 00:00:13,980
Express Server, and I'll start by installing Node one because then I want to keep on typing.

3
00:00:14,220 --> 00:00:16,460
Node server internal.

4
00:00:17,010 --> 00:00:23,670
And once we install it on a site on tolerance thought as partners, Save Dev has the dependency essentially

5
00:00:24,240 --> 00:00:30,240
in the package address, and I'll set up a script where I'll say Node Mount and server, so I will watch

6
00:00:30,240 --> 00:00:36,840
the changes in the server and every time it will restart the server for me, whatever you want to install

7
00:00:36,930 --> 00:00:37,560
express.

8
00:00:37,980 --> 00:00:46,560
And since we are using six modules now that the Import Express from Express set up basic app and I don't

9
00:00:46,560 --> 00:00:52,110
have a home around where I'll just send Malcolm online, we'll right away set up to port.

10
00:00:53,360 --> 00:00:55,490
Because this is what we'll do in the following videos.

11
00:00:55,880 --> 00:01:01,280
We will start utilizing the interview variables and I'm going to go with 5000.

12
00:01:01,310 --> 00:01:05,750
That is important because remember that our front end is running on 3000.

13
00:01:06,110 --> 00:01:11,840
So that's why I'm going with some kind of port that will not collide with a front end.

14
00:01:12,110 --> 00:01:17,930
And this, of course, is going to be useful once we push this up to a production line at the very,

15
00:01:17,930 --> 00:01:18,440
very end.

16
00:01:18,860 --> 00:01:19,700
Why do I want to do it?

17
00:01:20,040 --> 00:01:21,490
I want to go with that lesson.

18
00:01:21,870 --> 00:01:27,950
We've learned whatever is the portfolio and then I passing the callback function just to check whether

19
00:01:27,950 --> 00:01:29,720
everything is correct.

20
00:01:30,230 --> 00:01:32,950
So let's start over here by installing the enrollment.

21
00:01:33,380 --> 00:01:34,640
That's the first step.

22
00:01:35,330 --> 00:01:43,130
Once node monitors in place, then we want to navigate to a package soon on the server.

23
00:01:43,370 --> 00:01:44,570
That's very, very important.

24
00:01:44,900 --> 00:01:46,430
We don't care about the script here.

25
00:01:47,120 --> 00:01:49,940
We want to do is start line.

26
00:01:49,940 --> 00:01:55,040
We'll just be looking for no non node mount and then server.

27
00:01:55,460 --> 00:01:56,270
Let's save it.

28
00:01:56,630 --> 00:01:56,880
Yep.

29
00:01:57,380 --> 00:02:01,370
I have my dependency and now one side type and start.

30
00:02:02,490 --> 00:02:04,390
Than my server is running.

31
00:02:04,900 --> 00:02:12,130
And what's interesting, once we get the server up to speed as far as our frontline is concerned, viral

32
00:02:12,130 --> 00:02:17,770
spin up both with a concurrently package so installed concurrently package.

33
00:02:18,190 --> 00:02:25,450
And then we'll run both more on the server as well as the front end frontend, but that is still coming

34
00:02:25,450 --> 00:02:27,480
up next when we want to do it.

35
00:02:27,910 --> 00:02:29,480
Well, let's take a look at the preview.

36
00:02:29,920 --> 00:02:33,130
So we're done with Node Monarch, and that's good.

37
00:02:33,580 --> 00:02:36,310
The next one is installing the Express again.

38
00:02:36,610 --> 00:02:37,930
I'll stop the server for now.

39
00:02:38,410 --> 00:02:39,670
We'll grab the command here.

40
00:02:40,150 --> 00:02:40,990
I'll be in post.

41
00:02:41,380 --> 00:02:42,400
We installed on one.

42
00:02:42,710 --> 00:02:45,880
Now let's set up our basic express server.

43
00:02:46,270 --> 00:02:50,200
So let me run one more time and PM start.

44
00:02:50,590 --> 00:02:52,300
So now again, I have the node one.

45
00:02:52,630 --> 00:02:55,300
And now let's set up our express server.

46
00:02:55,600 --> 00:02:57,220
So I'm going to close the sidebar.

47
00:02:57,350 --> 00:02:59,290
I'm going to navigate to server address.

48
00:02:59,710 --> 00:03:07,930
And first of all, we want to do is import express from Express Import Express from Express Package.

49
00:03:08,380 --> 00:03:09,670
Man, let's set up right away.

50
00:03:09,670 --> 00:03:12,670
The app now will be equal to express.

51
00:03:12,970 --> 00:03:15,320
We invoke it inline.

52
00:03:15,400 --> 00:03:19,570
Let's come up with the ports variable and then we'll set up the home run.

53
00:03:20,020 --> 00:03:25,630
So let's go here with Konst Port is equal to process dot the envy.

54
00:03:25,690 --> 00:03:29,440
So we're accessing the environment variables and we're looking forward to port one.

55
00:03:29,830 --> 00:03:35,830
If it doesn't exist, then all hard code 5000 5000 when we want to invoke AMP, that lesson.

56
00:03:36,190 --> 00:03:40,150
So essentially, our server is going to start listening on a port.

57
00:03:40,480 --> 00:03:45,460
But the first time that we pass in the function and the second is going to be the callback function

58
00:03:45,640 --> 00:03:53,410
to arguments first, one port, second, one callback function once the server spins up and and in here

59
00:03:53,410 --> 00:04:01,150
we want to go with log and let's use a template string and I'll say server is listening port and now

60
00:04:01,150 --> 00:04:03,220
let's access the port variable.

61
00:04:03,580 --> 00:04:05,490
And then let's just go with on that.

62
00:04:05,800 --> 00:04:06,430
Let's say it.

63
00:04:06,790 --> 00:04:08,530
And it looks like everything is working.

64
00:04:08,830 --> 00:04:14,140
So now I can go above the port and let's set up some dummy route, which in my case is going to be a

65
00:04:14,140 --> 00:04:14,480
home run.

66
00:04:14,950 --> 00:04:15,580
Now, don't worry.

67
00:04:15,790 --> 00:04:19,930
Of course, we'll add more sophisticated set up in the second.

68
00:04:20,140 --> 00:04:27,340
So Rec André's those are our two parameters, and I'm just going to go with resonant sound and we're

69
00:04:27,340 --> 00:04:28,660
looking for a welcome.

70
00:04:29,140 --> 00:04:33,400
So let me invoke this one and I can navigate to my browser now.

71
00:04:33,400 --> 00:04:39,280
At the moment, I have localhost 3000, which is going to crash since there's no dev server backing

72
00:04:39,280 --> 00:04:39,610
this up.

73
00:04:39,610 --> 00:04:43,510
But if I go here with localhost, I'm not five thousand.

74
00:04:43,510 --> 00:04:45,610
I should see my welcome.

75
00:04:45,790 --> 00:04:47,440
And what I do.

76
00:04:47,620 --> 00:04:49,870
So now we know that everything is working.

77
00:04:50,620 --> 00:04:52,540
Most importantly, our imports.

78
00:04:52,750 --> 00:04:56,320
So that was the key thing where we did set up that time module.

79
00:04:56,530 --> 00:05:00,610
And now we can start using, yes, six modules in node land.

