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