1
00:00:04,270 --> 00:00:04,700
All right.

2
00:00:04,730 --> 00:00:10,280
We have just agreed that the very thrust to small application and run it using technology as container

3
00:00:10,550 --> 00:00:16,790
and it was the relatively easy all what we did to we actually executed specific file namely Hello de

4
00:00:16,790 --> 00:00:19,190
Jesus using Node interpreter.

5
00:00:19,190 --> 00:00:20,210
That's it.

6
00:00:20,220 --> 00:00:26,480
Now let's create a bit more complicated application with additional NPM package that we will need to

7
00:00:26,480 --> 00:00:30,210
install into our application locally on our computer.

8
00:00:30,380 --> 00:00:33,980
And for that we will use comment from docker container.

9
00:00:34,550 --> 00:00:35,330
Let's do that.

10
00:00:35,340 --> 00:00:41,260
Let's clear terminal and let's move to our visual studio called Project frost and he'll let me close

11
00:00:41,270 --> 00:00:49,430
hello do just file and let's create new for the inside of the node folder for that select load folder

12
00:00:49,490 --> 00:00:56,810
and click on this folder icon and create new folder named express like so and here inside of this folder

13
00:00:56,870 --> 00:01:03,980
let's create new file indexed the Jesus like so in the Lord Jesus and now let's open up web browser

14
00:01:04,069 --> 00:01:13,700
and type here in B Jesus dot com and PM in more just stands for note package manager and using NPM you're

15
00:01:13,710 --> 00:01:20,960
able to install many many different public open source packages and create the applications your obligations

16
00:01:21,140 --> 00:01:23,780
based on those third party packages.

17
00:01:24,230 --> 00:01:27,690
Let's switch here for package gold express.

18
00:01:27,980 --> 00:01:29,820
It is very very popular package.

19
00:01:29,840 --> 00:01:35,810
Let's click on this first link Express and you'll see that this package is the law that more than 11

20
00:01:35,900 --> 00:01:44,150
million times every week let's here scroll down and you'll see how to create very simple Express Web

21
00:01:44,300 --> 00:01:44,980
server.

22
00:01:45,230 --> 00:01:46,960
And let's use those comments.

23
00:01:46,970 --> 00:01:49,960
Let's simply copy all of them from this page.

24
00:01:50,030 --> 00:01:50,800
Copy them.

25
00:01:50,840 --> 00:01:57,800
Go to our IN THE LARGEST file here in Express folder and paste all files like salt and let's adjust

26
00:01:57,830 --> 00:01:59,110
this application a bit.

27
00:01:59,120 --> 00:02:01,450
Let's type here not killer rolled.

28
00:02:01,460 --> 00:02:13,840
Let's type this Express up was executed by node Jesus container inside of the like Sol was suppressing

29
00:02:13,990 --> 00:02:20,240
key combination out option Zi to remove horizontal scrolling and let's save the file and notice that

30
00:02:20,340 --> 00:02:27,360
our application will no listen at port three thousand and that means that we will need to use Port maybe

31
00:02:27,510 --> 00:02:33,720
if we want to connect to our Express Web Celera from outside and we will do that of course in this lecture.

32
00:02:33,720 --> 00:02:40,050
Great let's not try to execute this file using the same approach as we used in the previous lecture

33
00:02:40,440 --> 00:02:47,190
let's go to the terminal and here let's Cydia to express folder because now we allocated ignored folder

34
00:02:47,250 --> 00:02:53,760
we need to move to express folder City to express let's list files here and yes I see single in the

35
00:02:53,850 --> 00:02:58,620
largest file here and let's now use same command as we used before.

36
00:02:58,770 --> 00:03:05,070
Let me go to this comment in history and the let's adjusted and instead of hello de Jesus let's type

37
00:03:05,440 --> 00:03:12,300
in De Jesus and let's try to run this application using the same comment as it used for hello world

38
00:03:12,300 --> 00:03:20,720
application let's press enter and I see error cannot find module Express and the reason for that is

39
00:03:20,780 --> 00:03:28,910
very simple we need theorist don't look at this Express module from NPM and only afterwards run our

40
00:03:28,910 --> 00:03:36,260
application otherwise you'll get such errors module not found and again if I'll go back to this application

41
00:03:36,350 --> 00:03:43,050
in a visual studio called you'll see that we're actually require external module express here is this

42
00:03:43,050 --> 00:03:50,540
light responsible for that and that's why thrust we need to run npm install command for our application

43
00:03:51,230 --> 00:03:58,720
and if I'll try to do it locally on my computer using simply npm install command I'll get commanded

44
00:03:58,730 --> 00:04:06,190
found and VM because there was no no GST or NPM installed on my local computer and that's why we need

45
00:04:06,270 --> 00:04:14,630
some how Iran and install a command using not Jesus dawg our container question how are we able to do

46
00:04:14,630 --> 00:04:15,530
so.

47
00:04:15,750 --> 00:04:21,470
We are able to do so using the same approach as we used in the previous comment in the previous comment.

48
00:04:21,500 --> 00:04:28,160
We have overread read the default comment and here was custom comment that was executed after the start

49
00:04:28,220 --> 00:04:35,600
of this container and no we wanted to run npm install command and for that we don't simply replace this

50
00:04:35,600 --> 00:04:39,410
command note in the Logies with npm install command.

51
00:04:39,830 --> 00:04:46,340
But please note that all those two options will need to remain in place because we need to run in being

52
00:04:46,350 --> 00:04:50,120
install let's say in our local folder on our computer.

53
00:04:50,240 --> 00:04:51,260
Let's try it.

54
00:04:51,260 --> 00:05:01,780
Let me remove node in the genus and type here npm install and let's press enter and now I see some meaningful

55
00:05:01,850 --> 00:05:08,760
output after entering this command and it seems that the Lord container tried to install packages but

56
00:05:08,760 --> 00:05:10,020
do we see running.

57
00:05:10,090 --> 00:05:16,450
No such file or directory not able to open file package the Jason inside of the up folder inside of

58
00:05:16,450 --> 00:05:22,720
the container and that actually means that we need to first initialize our no Jesus project using NPM

59
00:05:22,830 --> 00:05:23,230
in need.

60
00:05:23,230 --> 00:05:28,770
Command and answer or some prompts and afterwards node container will create baggage.

61
00:05:28,790 --> 00:05:32,560
But Jason the file was told it was merely a terminal and the here.

62
00:05:32,560 --> 00:05:38,770
Let's go to this command and instead of embedding install Let's type NPM in it like so and now with

63
00:05:38,770 --> 00:05:39,320
selection.

64
00:05:39,340 --> 00:05:45,190
This prompt this utility will walk through creation of the package the gist on file and afterwards we

65
00:05:45,250 --> 00:05:48,340
see prompt to name our application or a package.

66
00:05:48,460 --> 00:05:54,100
And here is the full name up but afterwards this script actually terminated and the reason for that

67
00:05:54,190 --> 00:06:01,090
is that we cannot connect it to the end of this process and you may guess that we need to add Dash 8

68
00:06:01,130 --> 00:06:07,960
the options in order to be able to proceed with this interactive conversation with no GSM container.

69
00:06:07,990 --> 00:06:13,420
Let me clear a terminal and move to this command back and here let's add that a D.

70
00:06:13,460 --> 00:06:17,660
Options and make sure that you add those options somewhere before.

71
00:06:17,670 --> 00:06:20,240
Name of the node image.

72
00:06:20,260 --> 00:06:25,740
Let's browse Anton and now I am able to proceed with those prompts.

73
00:06:25,850 --> 00:06:30,340
I am happy with this default application name version is 1 0 0 0.

74
00:06:30,350 --> 00:06:32,340
Let's press Enter description is empty.

75
00:06:32,390 --> 00:06:38,060
Again I'll use the default values everywhere and re point in the Jesus death command to get repository

76
00:06:38,080 --> 00:06:40,640
keywords altar license ISC.

77
00:06:40,760 --> 00:06:46,680
And if I am happy with all those settings I could do press enter and file baggage.

78
00:06:46,700 --> 00:06:53,240
The Jason the file should not be created in our local folder Let's verify it allows.

79
00:06:53,810 --> 00:06:58,420
And yes I see actually two files package the Jason and package look.

80
00:06:58,490 --> 00:06:59,110
The Jason.

81
00:06:59,480 --> 00:07:04,520
I will not explain in details what this package looked the Jason File means but if I'll go to resorts

82
00:07:04,610 --> 00:07:10,040
to the gold and the gold to our Express application you'll see those files here as well.

83
00:07:10,040 --> 00:07:14,290
And if I'll have a look at the package the Jason the file you'll see this set off.

84
00:07:14,480 --> 00:07:20,150
Actually values assigned to some keys like name whereas some description and so on.

85
00:07:20,150 --> 00:07:20,730
Great.

86
00:07:20,750 --> 00:07:22,540
Now we are ready to try again.

87
00:07:22,550 --> 00:07:28,850
Installation of back just using npm install command but important outcome from this command is that

88
00:07:28,850 --> 00:07:35,480
the node just container has actually created files package and the Jason the file and this one inside

89
00:07:35,480 --> 00:07:38,520
of our local folder on our computer.

90
00:07:38,810 --> 00:07:44,510
And now those files actually belong to our application and you are able to run this application using

91
00:07:44,630 --> 00:07:47,810
any ours or not just container.

92
00:07:47,930 --> 00:07:52,340
All right let's not go to terminal and let's run and being install a command.

93
00:07:52,460 --> 00:07:58,070
But actually we need to run in being this document along with name of the package we want to install

94
00:07:58,070 --> 00:08:01,980
into our project and name of the package use Express.

95
00:08:02,090 --> 00:08:03,020
Here it is.

96
00:08:03,020 --> 00:08:04,970
Let's go to terminal end here.

97
00:08:04,970 --> 00:08:14,240
Let's clear it quickly and let's run command npm install express like so here was and type comment that

98
00:08:14,240 --> 00:08:17,080
will be executed off the start of this container.

99
00:08:17,170 --> 00:08:24,900
And please note that each time when we run such command we actually start brand new container let's

100
00:08:24,900 --> 00:08:31,730
both Antigua and now you see that the summer job is undergoing right now and you'll see now that express

101
00:08:31,730 --> 00:08:34,750
package was installed into our project.

102
00:08:34,909 --> 00:08:37,909
And now if I would go to visual studio called you should see here.

103
00:08:38,120 --> 00:08:39,140
Let's refresh.

104
00:08:39,140 --> 00:08:39,970
You should see here.

105
00:08:39,990 --> 00:08:46,090
Note modules folder inside of the Express folder and inside of that folder you'll see by each of our

106
00:08:46,100 --> 00:08:51,550
folders that contain actually additional packages that were installed along with Express package.

107
00:08:51,570 --> 00:08:56,370
That's because express package itself has by each of its own dependencies.

108
00:08:56,390 --> 00:09:01,730
And here you see that in total fifty packages from 37 contributors were added.

109
00:09:01,730 --> 00:09:02,360
Great.

110
00:09:02,360 --> 00:09:08,500
That's how we were able finally install express package into our not just application.

111
00:09:08,570 --> 00:09:15,650
And notice that for that we have used no GSK container and we have executed some NPM commands inside

112
00:09:15,650 --> 00:09:17,120
of that container.

113
00:09:17,120 --> 00:09:18,840
It is very very important.

114
00:09:18,890 --> 00:09:25,670
We have not used node or NPM locally on our computer because the simply absent the moment great let's

115
00:09:25,670 --> 00:09:31,100
not wait to start our application once again using Node in the GSK comment.

116
00:09:31,100 --> 00:09:37,160
Let's clear terminal and go back to this command and instead of NPM install express let's type node

117
00:09:37,400 --> 00:09:39,080
index.

118
00:09:39,380 --> 00:09:41,350
Here was our intelligence file.

119
00:09:41,480 --> 00:09:42,170
Here it is.

120
00:09:42,290 --> 00:09:48,920
And we want to execute it using Node less porous Antrim and we see that we have connected actually to

121
00:09:49,010 --> 00:09:53,800
node Jesus brought us inside of the container and container now is up and run.

122
00:09:53,900 --> 00:10:00,230
Let's open up new tap and here let's verify that Docker appears and you'll see that this container is

123
00:10:00,350 --> 00:10:07,310
up and now we're actually able to verify whether we're able to connect to our Express Sara or not.

124
00:10:07,310 --> 00:10:12,950
And you may guess that we will be able to connect to the sport and I am sure that you know the answer.

125
00:10:13,070 --> 00:10:19,760
We cannot actually mapped external port to this internal port three thousand but let's anyway try it

126
00:10:19,760 --> 00:10:28,210
to open up web browser and here let's type local Horst column three thousand like so.

127
00:10:28,210 --> 00:10:29,790
And of course I see this error.

128
00:10:29,800 --> 00:10:35,670
This site can be reached let's not modify our command here and let's at also port.

129
00:10:35,930 --> 00:10:37,270
Let's go to the step.

130
00:10:37,270 --> 00:10:43,480
Let's terminate our application and you'll see that actually this doesn't work with this process because

131
00:10:43,560 --> 00:10:51,730
we're connected directly to node G.S. process that at the moment doesn't actually handle seek in signal.

132
00:10:51,730 --> 00:10:56,830
Let's go to the step and let's stop this container manually using Docker stop.

133
00:10:56,850 --> 00:10:58,750
Command and let's type here.

134
00:10:59,050 --> 00:11:01,190
A seven for example.

135
00:11:01,300 --> 00:11:06,880
Actually we need to use a docker killed better because we will need to wait 10 seconds because again

136
00:11:07,030 --> 00:11:11,010
six term signal is also not recognised by Noel just brought us.

137
00:11:11,050 --> 00:11:16,180
And finally in 10 seconds this container will stop and defy will go by here you'll see that this process

138
00:11:16,270 --> 00:11:16,940
is over.

139
00:11:17,380 --> 00:11:19,140
Let's no at also port Megan.

140
00:11:19,480 --> 00:11:26,070
And here for that let's use option that beam and let's say that we want to simply run this.

141
00:11:26,140 --> 00:11:32,750
No just express application using same boat as was opened by express application itself it is three

142
00:11:32,750 --> 00:11:33,450
thousand.

143
00:11:33,610 --> 00:11:39,400
Let's go here and type three thousand as external port and optical Let's type through a thousand as

144
00:11:39,490 --> 00:11:44,880
internal port as well let's not press enter and see whether we will be able to connect to our expressway

145
00:11:44,910 --> 00:11:45,310
etcetera.

146
00:11:45,310 --> 00:11:49,690
Now let's go to Google Chrome and here let's refresh page.

147
00:11:49,690 --> 00:11:51,100
And now I see my message.

148
00:11:51,100 --> 00:11:55,270
This Express up was executed by no gas container inside of the door.

149
00:11:55,540 --> 00:12:01,480
And that means that now our report made big rocks and now our tiny express application works as well.

150
00:12:01,480 --> 00:12:08,350
And again for that we are required to enter some NPM commands in order to install express package inside

151
00:12:08,350 --> 00:12:10,130
of our Express application.

152
00:12:10,240 --> 00:12:14,850
And if l go to package the Jason File you'll see additional dependency that was added here.

153
00:12:14,860 --> 00:12:17,510
This file and this express package.

154
00:12:17,710 --> 00:12:18,360
Great.

155
00:12:18,370 --> 00:12:24,970
Now let me demonstrate to how we're able to handle control seem inside of the node GSR application and

156
00:12:24,970 --> 00:12:26,670
let's adjust our application a bit.

157
00:12:26,680 --> 00:12:28,420
But let's do it after the small bowls.

158
00:12:28,420 --> 00:12:29,050
See you next.

159
00:12:29,050 --> 00:12:29,430
Bye bye.

