1
00:00:01,110 --> 00:00:03,370
I am back over inside my packages directory.

2
00:00:03,780 --> 00:00:09,810
There's our local API package right there, so we're going to use the Lernout command to install Xpress

3
00:00:09,960 --> 00:00:14,260
and a type definition package or express into our local API project.

4
00:00:14,610 --> 00:00:18,750
We are also going to install one or two other modules along the way and we'll talk about what these

5
00:00:18,750 --> 00:00:20,220
additional ones are in due time.

6
00:00:20,640 --> 00:00:24,290
Now, remember, we are using Lernout to do all these NPM installs.

7
00:00:24,300 --> 00:00:26,040
We are not running and install directly.

8
00:00:26,520 --> 00:00:31,560
The one downside to using Lernout for managing all of our packages is that we can only add one package

9
00:00:31,560 --> 00:00:32,159
at a time.

10
00:00:32,460 --> 00:00:35,330
So we're gonna have to run, learn to add a couple of times in this video.

11
00:00:35,730 --> 00:00:38,040
So let's get to it because it will take a little bit of time.

12
00:00:38,850 --> 00:00:42,420
Well, first, begin with a llena ad xpress.

13
00:00:44,340 --> 00:00:45,360
I'm going to set the scope.

14
00:00:46,380 --> 00:00:50,430
So we only want to install Xpress into our local API package.

15
00:00:52,390 --> 00:00:53,170
We're going to run that.

16
00:00:55,470 --> 00:00:58,680
And in just a moment or two, it should be installed very good.

17
00:00:59,630 --> 00:01:05,090
Next up, we will do a llena ad at Type's Express.

18
00:01:06,250 --> 00:01:08,350
I want to say this as a development dependancy.

19
00:01:09,490 --> 00:01:12,700
And then the scope will be local API.

20
00:01:19,960 --> 00:01:24,850
Just two more very quickly, we're going to do a llena ad course.

21
00:01:26,560 --> 00:01:28,600
SCOP, once again will be at local AP.

22
00:01:33,480 --> 00:01:36,570
Learn to add at types, of course.

23
00:01:37,730 --> 00:01:44,030
Again, we will see if that as a development dependency with dash, dash, dev, scope of local API.

24
00:01:47,810 --> 00:01:55,790
And then here's for real this time, though, the actual last one we need will be learn to add HTP proxy

25
00:01:55,790 --> 00:01:56,540
middleware.

26
00:01:57,830 --> 00:02:00,740
And again, a scope of local dash API.

27
00:02:04,630 --> 00:02:05,890
OK, so that should be at.

28
00:02:06,870 --> 00:02:10,470
What we've now added in a couple of different packages, we haven't really discussed what the course

29
00:02:10,470 --> 00:02:15,290
package is for or what proxy middleware are for either, but don't worry.

30
00:02:15,300 --> 00:02:17,700
Again, we'll discuss what this is all about in due time.

31
00:02:18,000 --> 00:02:19,910
Right now, let's go back over to our code editor.

32
00:02:19,920 --> 00:02:23,370
We're going to start to set up Express inside of our local API package.

33
00:02:24,470 --> 00:02:30,800
So back over at my editor, I'm going to find the local API package, here's the folder I'm inside of

34
00:02:30,800 --> 00:02:31,240
index.

35
00:02:31,380 --> 00:02:31,800
Yes.

36
00:02:32,770 --> 00:02:36,160
So we've got our search function inside of here, the inside of this function.

37
00:02:36,480 --> 00:02:38,740
I'm going to remove all the control logs we currently have.

38
00:02:40,010 --> 00:02:43,910
And inside of this function, we're going to do all the initial set up for our express server.

39
00:02:44,780 --> 00:02:46,070
So in this case, at the very top.

40
00:02:47,020 --> 00:02:48,130
I'm going to import.

41
00:02:49,210 --> 00:02:51,490
Express from Express.

42
00:02:54,150 --> 00:02:57,480
Inside of the serve function, I will create my express app.

43
00:03:00,070 --> 00:03:02,410
We won't associate any roots with this just yet.

44
00:03:02,440 --> 00:03:06,760
Let's just go ahead and have it start listening on the port that is provided to our search function.

45
00:03:08,060 --> 00:03:09,650
So that would normally be an app.

46
00:03:09,920 --> 00:03:15,290
Listen on the given reports and then, of course, we might also want to have a little color back inside

47
00:03:15,290 --> 00:03:21,440
of your and do something like that, log listening on words and then just print out.

48
00:03:22,770 --> 00:03:23,760
The port right after.

49
00:03:25,240 --> 00:03:28,510
Now, the code that we have right here is going to work just fine, let's try to run it at our terminal

50
00:03:28,510 --> 00:03:29,110
very quickly.

51
00:03:29,410 --> 00:03:33,490
But I want you to be aware that we're going to run into one or two kind of interesting things when we

52
00:03:33,490 --> 00:03:36,100
start thinking about air handling around our Seelie.

53
00:03:36,560 --> 00:03:40,360
So, again, for right now, let's just go back over to our terminal, just run this and make sure everything

54
00:03:40,360 --> 00:03:41,350
works as expected.

55
00:03:43,200 --> 00:03:49,170
So back over at my terminal to start up our local API, we have to use our Seelie that we put together.

56
00:03:49,630 --> 00:03:51,990
So we're going to change back into our Seelie package.

57
00:03:53,910 --> 00:03:58,620
We will change into that dist directory because remember, that is currently how we are going to run

58
00:03:58,620 --> 00:03:59,250
our Seelie.

59
00:03:59,490 --> 00:04:02,760
We're going to execute that node or joining that index, not just file.

60
00:04:03,980 --> 00:04:08,000
So I'll do a node index dogs serve.

61
00:04:09,140 --> 00:04:11,840
And we should see listening on PT. four thousand five here.

62
00:04:12,760 --> 00:04:16,220
OK, well, it looks pretty reasonable right now, but like I said, we're going to very quickly run

63
00:04:16,220 --> 00:04:18,500
into some interesting issues around air handling.

64
00:04:18,800 --> 00:04:20,980
Let's take a pause right here and come back in just a moment.

