1
00:00:00,330 --> 00:00:08,340
Beautiful and in the same fashion, let's set up a rest of the controllers so we have to get one now,

2
00:00:08,340 --> 00:00:14,220
I want to create one for the post, one forget, but that's going to be a single item.

3
00:00:14,490 --> 00:00:18,360
And we also have one for patch and one for delete.

4
00:00:18,690 --> 00:00:23,620
And pretty much in all of them set up is going to be exactly the same as far as functionality.

5
00:00:24,000 --> 00:00:30,990
I'll just stand back and I'll say what the controller has done since, of course, we haven't connected

6
00:00:31,170 --> 00:00:33,870
to the database or anything like that.

7
00:00:34,230 --> 00:00:36,150
And I just need to come up with a name.

8
00:00:36,150 --> 00:00:39,150
In my case, I'm going to go with create a task.

9
00:00:39,480 --> 00:00:46,740
And again, we have Orac an address and then we want to copy and paste since I want to speed this up

10
00:00:47,010 --> 00:00:51,320
and I'll just say create task, create task.

11
00:00:51,340 --> 00:00:59,670
And why don't we change this one around and also get all tasks now where we want to copy and paste and

12
00:00:59,670 --> 00:01:00,690
we'll have three more.

13
00:01:01,140 --> 00:01:04,050
We'll have one for getting the task.

14
00:01:04,349 --> 00:01:05,519
So get task.

15
00:01:05,880 --> 00:01:14,610
And here we'll get a single task, then we'll have one for updating and that's exactly how we'll call

16
00:01:14,610 --> 00:01:14,820
it.

17
00:01:14,820 --> 00:01:16,590
We'll say update task.

18
00:01:17,090 --> 00:01:18,810
The same is going to be on here.

19
00:01:19,020 --> 00:01:23,310
And then the last one, of course, will be the lead and then task.

20
00:01:23,880 --> 00:01:26,970
And you guessed that we also need to change the text.

21
00:01:27,540 --> 00:01:31,590
And now, of course, we want to place that in the same object.

22
00:01:31,980 --> 00:01:38,220
So let's go with create task, then get a task and we have update task.

23
00:01:38,580 --> 00:01:40,560
And last one is the task.

24
00:01:40,890 --> 00:01:44,430
And then back in the Roots course, we want to empower them.

25
00:01:44,880 --> 00:01:51,300
So say here, create task, get task one, update task and delete one.

26
00:01:51,600 --> 00:01:54,120
And now we just need to set up the roots.

27
00:01:54,450 --> 00:02:02,490
If we take a look at the IMGs, these to the get and post are going to go to API version one and then

28
00:02:02,490 --> 00:02:10,530
tasks and then the rest of them are going to be we added problems, so same initial path, but then

29
00:02:10,530 --> 00:02:17,240
when we'll just default on ID and that's of course is where we're going to pass the idea of the task.

30
00:02:17,730 --> 00:02:22,830
So where I have to get requests to get all the tasks, I'll chain that post.

31
00:02:23,100 --> 00:02:30,060
And of course, which control are we going to use because the create task one and then we can simply

32
00:02:30,270 --> 00:02:33,600
go to the next line and we'll go with router.

33
00:02:34,500 --> 00:02:43,650
Then route and like I said, will go with ports and then ID and then we're looking for Getrude and I

34
00:02:43,660 --> 00:02:50,080
will be equal to get the single task, then we'll set up our patch and that will be equal to update

35
00:02:50,080 --> 00:02:50,390
task.

36
00:02:50,640 --> 00:02:55,430
And then lastly, we have delete one and now will be equal to the task.

37
00:02:55,890 --> 00:03:04,000
Now, since we know that we can only really test the single desk and get all tasks because that's the

38
00:03:04,000 --> 00:03:07,800
default method the browser performs will stop over here.

39
00:03:08,070 --> 00:03:15,360
And in the next video, we'll spin up the postman to quickly test all of our routes, because trust

40
00:03:15,360 --> 00:03:22,530
me, you don't want to go any further without knowing that at least the basic setup works because you

41
00:03:22,530 --> 00:03:24,690
can set up whatever logic you have or hear.

42
00:03:25,140 --> 00:03:32,250
If there is a small bug and you cannot access the strings, then you'll spend way more time later searching

43
00:03:32,250 --> 00:03:33,060
for that bug.

