1
00:00:00,330 --> 00:00:00,690
All right.

2
00:00:01,050 --> 00:00:05,640
And once her front end is in place now, let's secure our server.

3
00:00:06,330 --> 00:00:09,300
And what's really cool with the help of community?

4
00:00:09,810 --> 00:00:11,730
So think npm packages?

5
00:00:12,420 --> 00:00:14,340
It's really pretty straightforward.

6
00:00:15,060 --> 00:00:19,200
We'll just need to install a few libraries and set it up on our server.

7
00:00:19,740 --> 00:00:29,250
In this project, we will install Helmick to secure our headers x ss clean to sanitize user input and

8
00:00:29,250 --> 00:00:38,280
as a result, prevent cross-site scripting attacks, express Mongo sanitize to prevent MongoDB operator

9
00:00:38,430 --> 00:00:46,230
injection and express a right limit to limit the amount of requests by one IP address.

10
00:00:46,890 --> 00:00:53,610
Now I did provide the links to the libraries, so if you want to learn more about the packages, just

11
00:00:53,610 --> 00:00:54,330
utilize them.

12
00:00:54,870 --> 00:00:58,050
But like I just said, it's pretty straightforward.

13
00:00:58,530 --> 00:01:03,870
First, we just want to install all of them and then we want to set them up as middleware.

14
00:01:04,349 --> 00:01:11,340
So I pushed right away in the read me the entire command where we just go with npm install and then

15
00:01:11,760 --> 00:01:15,690
all of the packages for all utilize that.

16
00:01:16,140 --> 00:01:17,130
Copy and paste.

17
00:01:17,550 --> 00:01:20,910
I'll install them now while the packages are being installed.

18
00:01:21,300 --> 00:01:27,960
I also want to remove the log in the error handler, so we're setting that one up while we were developing.

19
00:01:28,200 --> 00:01:30,720
And I think now it's a great time to remove it.

20
00:01:31,180 --> 00:01:34,890
So let's navigate your middleware, more specifically our handler.

21
00:01:35,410 --> 00:01:43,620
Unless you just remove this console, log for the error, and then let's start in this video by setting

22
00:01:43,620 --> 00:01:45,090
up these packages.

23
00:01:45,870 --> 00:01:47,670
So I want to get home at.

24
00:01:48,730 --> 00:01:51,580
Excess clean and Mango senators.

25
00:01:52,060 --> 00:02:00,370
And then right after CreditJason, let's invoke them as middle so ago goes up years and then provide

26
00:02:00,370 --> 00:02:02,290
the package and invoke it.

27
00:02:02,620 --> 00:02:09,850
And in the next video, we'll worry about the question because although a bit of a different setup.

28
00:02:10,660 --> 00:02:15,790
So first, let's navigate a server, I guess, right off their path.

29
00:02:16,400 --> 00:02:18,400
But kind of makes more sense to me.

30
00:02:18,800 --> 00:02:23,170
Want to go with helmet I was coming from and I'm looking for a library.

31
00:02:23,380 --> 00:02:26,070
And the same is going to be with access screen.

32
00:02:26,440 --> 00:02:31,720
So in this case, they're going to go with exercise and let's look for the package.

33
00:02:32,170 --> 00:02:35,590
And then lastly, we want to do the same thing with Mongo senators.

34
00:02:35,770 --> 00:02:37,210
So important ban.

35
00:02:37,720 --> 00:02:38,740
Let's come up with the name.

36
00:02:39,010 --> 00:02:47,380
I guess in my case, I'm going to go with Mongo sanitizer and that is coming from the Express Mongo

37
00:02:47,740 --> 00:02:49,090
Sanitize package.

38
00:02:49,480 --> 00:02:50,560
Let's save it.

39
00:02:51,230 --> 00:02:55,240
And let me just make sure so sanitize over here.

40
00:02:55,330 --> 00:02:59,230
Of course, there was spelling is not my best friend.

41
00:02:59,710 --> 00:03:01,000
So let's keep on moving.

42
00:03:01,200 --> 00:03:03,910
And like I said, right off, throw expression or something.

43
00:03:04,250 --> 00:03:05,890
I was just going about use.

44
00:03:06,310 --> 00:03:07,570
Let's start with the helmet.

45
00:03:08,110 --> 00:03:08,740
Invoke it.

46
00:03:09,370 --> 00:03:12,880
Copy and paste can simply change these variables around.

47
00:03:13,030 --> 00:03:18,760
So this is going to be access and the next one will be the mom or sanitizer.

48
00:03:19,270 --> 00:03:22,120
So that sets up these three packages again.

49
00:03:22,270 --> 00:03:24,310
How much is there secured headers?

50
00:03:24,730 --> 00:03:33,700
Access as clean is to make sure that we sanitize the input so we prevent the cross-site scripting attacks.

51
00:03:34,060 --> 00:03:41,050
And when it comes to Mongo sanitize, essentially it prevents the MongoDB operator injection.

