1
00:00:02,000 --> 00:00:05,000
Now, that is it for this course section.

2
00:00:05,000 --> 00:00:08,000
As mentioned multiple times throughout the section,

3
00:00:08,000 --> 00:00:10,000
you can absolutely work on the front end.

4
00:00:10,000 --> 00:00:14,000
You can improve the feedback, the user interface there.

5
00:00:14,000 --> 00:00:17,000
You can show a loading and a error state,

6
00:00:17,000 --> 00:00:20,000
and give the user better feedback about what's happening.

7
00:00:20,000 --> 00:00:24,000
That's all standard react, not next specific,

8
00:00:24,000 --> 00:00:28,000
and definitely not API route specific.

9
00:00:28,000 --> 00:00:32,000
This module was about practicing API routes, though.

10
00:00:32,000 --> 00:00:34,000
And here, you'll learn a lot about them.

11
00:00:34,000 --> 00:00:36,000
You, again, saw that you can create static

12
00:00:36,000 --> 00:00:41,000
and dynamic API routes, where data is encoded in the URL.

13
00:00:42,000 --> 00:00:45,000
And you learned how you add your own API routes

14
00:00:45,000 --> 00:00:48,000
that you can run any service and logic you want in there

15
00:00:48,000 --> 00:00:50,000
and that you can, for example,

16
00:00:50,000 --> 00:00:53,000
use them to connect to a real database.

17
00:00:53,000 --> 00:00:56,000
In this case to MongoDB.

18
00:00:56,000 --> 00:01:00,000
You then learned that you can send back different responses,

19
00:01:00,000 --> 00:01:03,000
both error and success responses,

20
00:01:03,000 --> 00:01:06,000
and how you can manage your code flow,

21
00:01:06,000 --> 00:01:08,000
and the function execution

22
00:01:08,000 --> 00:01:11,000
with your different return statements

23
00:01:11,000 --> 00:01:15,000
with the different responses and with different if checks,

24
00:01:15,000 --> 00:01:18,000
for example, by checking for the request method.

25
00:01:18,000 --> 00:01:22,000
Being able to use API routes is very important

26
00:01:22,000 --> 00:01:25,000
because for a lot of websites and web applications

27
00:01:25,000 --> 00:01:28,000
you will be building you don't just want

28
00:01:28,000 --> 00:01:31,000
to have pages that can be pre-rendered.

29
00:01:31,000 --> 00:01:34,000
But you often do want certain service and logic

30
00:01:34,000 --> 00:01:36,000
that should be executed on demand.

31
00:01:36,000 --> 00:01:39,000
For example, when a user signs up for a newsletter,

32
00:01:39,000 --> 00:01:43,000
or leaves a comment, just as we added it here.

