1
00:00:00,330 --> 00:00:05,520
And as far as our roads, let's start with our jazz, and, of course, we need to set up the router,

2
00:00:05,820 --> 00:00:06,990
so let's go with CONSED.

3
00:00:06,990 --> 00:00:09,540
Express is equal to acquire.

4
00:00:10,610 --> 00:00:16,280
Choir and of course, I'm looking for Xpress, remember, we need to go with some kind of variable and

5
00:00:16,280 --> 00:00:21,170
my router and we'll set it equal to your express dot and router.

6
00:00:21,320 --> 00:00:26,620
We invoke it and then we'll import both of the functions from our controller.

7
00:00:26,630 --> 00:00:29,240
And remember, the names were registered and login.

8
00:00:29,270 --> 00:00:32,870
So let's go over here and log in and register.

9
00:00:33,140 --> 00:00:36,910
And both of these things are coming from our controller, the OTH one.

10
00:00:37,250 --> 00:00:38,650
So let's navigate over there.

11
00:00:38,660 --> 00:00:41,570
We have controllers and of course the fourth one.

12
00:00:41,750 --> 00:00:45,200
And once I have my imports in place now, of course we just need to set up the routes.

13
00:00:45,590 --> 00:00:53,630
And if you remember, we also have an option of router and then dot and then whatever is the method.

14
00:00:53,840 --> 00:00:55,730
And both of these are going to be the post routes.

15
00:00:55,730 --> 00:01:03,800
So I'll simply go with router that post and then we go with Fort's or Register and then of course will

16
00:01:03,800 --> 00:01:05,239
pass in our controller.

17
00:01:05,660 --> 00:01:08,930
After that, we'll copy and paste again, router that post.

18
00:01:09,260 --> 00:01:15,740
In this case, we're looking for the login one and of course the controller will invoke he is also going

19
00:01:15,740 --> 00:01:16,730
to be a logging one.

20
00:01:17,090 --> 00:01:23,770
And then at the very, very end, we'll just go with module exports that is equal to the router.

21
00:01:24,140 --> 00:01:27,080
So that should do it for all of us.

22
00:01:27,080 --> 00:01:33,650
And before we navigate to abcess and important and set it up, let's also do the same thing with the

23
00:01:33,650 --> 00:01:38,900
jobs router, because essentially the idea is exactly the same where I want to go to jobs.

24
00:01:38,900 --> 00:01:46,290
And again, in order to speed it up, let's just take these two lines of code and I'm sorry and navigate

25
00:01:46,290 --> 00:01:47,880
navigated through the wrong file.

26
00:01:48,110 --> 00:01:50,300
So here in the jobs I set up throughout our.

27
00:01:50,300 --> 00:01:50,610
Yep.

28
00:01:50,720 --> 00:01:52,040
That stays the same.

29
00:01:52,400 --> 00:01:55,280
And now we just want to go with const.

30
00:01:55,760 --> 00:01:58,790
We want to import, we want to import, get all the jobs.

31
00:01:59,790 --> 00:02:00,660
Good job.

32
00:02:01,640 --> 00:02:03,980
Also, I'm going to be looking for create job.

33
00:02:04,900 --> 00:02:05,690
Great job.

34
00:02:05,790 --> 00:02:12,100
Then we want to update the job and lastly, we want to get a job or I'm sorry, not get a job, the

35
00:02:12,250 --> 00:02:18,430
job, the lead and job and all of that is coming again from the controllers.

36
00:02:18,430 --> 00:02:18,820
Correct.

37
00:02:19,180 --> 00:02:23,890
So go with require and set it equal to the controllers folder.

38
00:02:24,220 --> 00:02:26,400
And of course, we're looking for the jobs.

39
00:02:26,860 --> 00:02:31,720
And once we have these important place now, of course, we'll do the other way where we go, that route

40
00:02:31,720 --> 00:02:39,040
or that route, and then we'll have post and get on the slash and then we'll have the get delete and

41
00:02:39,040 --> 00:02:42,040
patch on forward slash and then the program.

42
00:02:42,310 --> 00:02:43,810
So let's go with router.

43
00:02:44,880 --> 00:02:50,530
That route and this is going to be the forward slash, of course, and therefore will go with post.

44
00:02:50,910 --> 00:02:54,730
So this is going to be to the job and get all the jobs.

45
00:02:54,750 --> 00:02:57,720
Remember, that was the structure for rest API.

46
00:02:57,960 --> 00:03:00,930
And we're looking for controller of Create Job.

47
00:03:01,320 --> 00:03:07,710
Of course, let's go with DOT and then get and this is going to get me all the jobs, vinyl copy and

48
00:03:07,710 --> 00:03:10,050
paste and adhere to it.

49
00:03:10,440 --> 00:03:17,520
Remember the root problems and in this case we're not going to have post so I can remove this one and

50
00:03:17,520 --> 00:03:18,450
I'll start with get.

51
00:03:18,790 --> 00:03:21,330
Now this is going to get me the single job here.

52
00:03:21,810 --> 00:03:24,140
Then we're going to have one for delete.

53
00:03:24,570 --> 00:03:27,500
Of course, the controller is the only job.

54
00:03:27,510 --> 00:03:34,430
And then lastly, we have one for Patch and here will pass in of dayjob online at the very, very end.

55
00:03:34,440 --> 00:03:39,840
Of course, I want to go with module that exports and the router.

56
00:03:39,840 --> 00:03:45,200
Now, of course, if you prefer this index, you can also use it here in all Jase's.

57
00:03:45,270 --> 00:03:52,080
I just thought that this is a nice refresher where of course we can set up our roots this way as well.

58
00:03:52,510 --> 00:03:58,860
And once we have both of the world files in place now of course we just need to go to objets.

59
00:03:59,190 --> 00:04:00,920
We need to import both of them.

60
00:04:01,320 --> 00:04:03,780
And again, so this is really up to you.

61
00:04:04,140 --> 00:04:10,260
But I'm going to do that above the error handlers because there's also going to be a can actually be

62
00:04:10,260 --> 00:04:10,550
here.

63
00:04:10,920 --> 00:04:13,400
So connect the B is still coming up.

64
00:04:13,410 --> 00:04:18,430
Let's just go with routers and here say comes off router.

65
00:04:18,839 --> 00:04:21,110
And that, of course, is equal to require.

66
00:04:21,510 --> 00:04:24,000
And we're looking in the roots.

67
00:04:24,540 --> 00:04:29,970
And then more specifically because I want to access the auth one copy and paste.

68
00:04:30,150 --> 00:04:37,320
And this is going to be a jobs are of course, this is coming from roots and ports and jobs.

69
00:04:37,770 --> 00:04:40,480
And then I don't think we need a dummy one anymore.

70
00:04:40,510 --> 00:04:44,130
I think we're pretty clear on what's happening now.

71
00:04:44,150 --> 00:04:47,250
Of course, let's remove it, let's say abduh years.

72
00:04:47,610 --> 00:04:53,340
And as far as the path, I'm going to go with API version one again, that's my set in a post.

73
00:04:53,340 --> 00:04:56,040
Marceaux We might as well continue using that one.

74
00:04:56,370 --> 00:05:00,620
And as far as the OTH, I'm not going to go forward slash off.

75
00:05:00,840 --> 00:05:08,130
And of course, what that means in here, we have the full part of API version one OTH and then a register

76
00:05:08,940 --> 00:05:10,680
and the same goes for the login.

77
00:05:11,070 --> 00:05:18,030
And as far as the jobs will do, exactly the same will go with API version jobs and then the forward

78
00:05:18,030 --> 00:05:24,630
slash is just going to have to create one and get all of them and the root problems will have the rest

79
00:05:24,630 --> 00:05:25,170
of the story.

80
00:05:25,320 --> 00:05:29,270
Hopefully that is clear because again we pretty much keep repeating the same thing.

81
00:05:29,280 --> 00:05:35,060
So let's go with API version one and then off and then let just passing the author.

82
00:05:35,760 --> 00:05:39,660
So now of course, we just need to copy and paste and let's go Jowzjan.

83
00:05:40,320 --> 00:05:44,190
And of course now we want to implement the jobs router.

84
00:05:44,430 --> 00:05:45,630
So say over here.

85
00:05:45,960 --> 00:05:51,810
And I don't think I'm going to do any kind of testing since it doesn't make sense at the moment.

86
00:05:52,200 --> 00:05:53,670
I'm just going to check my error.

87
00:05:53,910 --> 00:05:55,680
So it says over here router.

88
00:05:55,680 --> 00:06:00,010
That post requires a callback function, but it's not given.

89
00:06:00,190 --> 00:06:03,930
So let's say let's say maybe I didn't export something.

90
00:06:04,470 --> 00:06:06,210
So let's go to jobs.

91
00:06:06,250 --> 00:06:07,590
That's the router.

92
00:06:08,340 --> 00:06:12,050
And of course, I'm looking here for auth one for some reason.

93
00:06:12,480 --> 00:06:19,440
So let me move this one and line as far as create job, looks like I didn't export it or something along

94
00:06:19,440 --> 00:06:19,950
those lines.

95
00:06:20,370 --> 00:06:22,080
So let me take a look at the jobs.

96
00:06:22,710 --> 00:06:25,140
Of course, there's a naming issue.

97
00:06:25,530 --> 00:06:27,240
It's a create job.

98
00:06:27,600 --> 00:06:31,580
So create job and of course, need to do it over here as well.

99
00:06:31,950 --> 00:06:38,550
So once I fix this tiny bug now, we should be heading in the right direction where we have the roots,

100
00:06:38,760 --> 00:06:40,350
we have the controllers.

101
00:06:40,620 --> 00:06:42,960
So now, of course, we just need to start adding the logic.

102
00:06:43,410 --> 00:06:49,080
And the reason why I'm not testing anything right now, because, of course, will work in each of the

103
00:06:49,080 --> 00:06:50,880
controllers quite extensively.

104
00:06:51,270 --> 00:06:57,630
And before we do anything, of course, we'll just check whether we're getting this silly string response.

105
00:06:57,810 --> 00:07:01,230
And if we do, then, of course, we'll work on our logic.

