1
00:00:02,000 --> 00:00:04,000
And that's it for API routes,

2
00:00:04,000 --> 00:00:08,000
another very useful feature Next.js offers to you.

3
00:00:08,000 --> 00:00:10,000
A feature, which you won't need

4
00:00:10,000 --> 00:00:12,000
in every project you're building.

5
00:00:12,000 --> 00:00:15,000
Not every Next website needs API routes.

6
00:00:15,000 --> 00:00:18,000
But if you have some backend functionality

7
00:00:18,000 --> 00:00:22,000
that should be triggered through client side code,

8
00:00:22,000 --> 00:00:23,000
like we're doing it here

9
00:00:23,000 --> 00:00:26,000
for loading feedback or for storing feedback,

10
00:00:26,000 --> 00:00:29,000
then API routes can be super useful

11
00:00:29,000 --> 00:00:31,000
because they allow you to add

12
00:00:31,000 --> 00:00:33,000
extra functionality to your website,

13
00:00:33,000 --> 00:00:36,000
which might rely on an API

14
00:00:36,000 --> 00:00:38,000
like users sign up for a newsletter

15
00:00:38,000 --> 00:00:42,000
without having to build an extra API backend.

16
00:00:42,000 --> 00:00:45,000
Without having to build a totally different project.

17
00:00:45,000 --> 00:00:49,000
Instead, you can easily inject API routes

18
00:00:49,000 --> 00:00:50,000
as we're doing it here

19
00:00:50,000 --> 00:00:54,000
by using this special API folder in the pages folder.

20
00:00:54,000 --> 00:00:56,000
And you can write service side code here,

21
00:00:56,000 --> 00:01:01,000
which is then triggered for requests to these API routes.

22
00:01:02,000 --> 00:01:04,000
And here you learned that you can find out

23
00:01:04,000 --> 00:01:06,000
which kind of request was sent,

24
00:01:06,000 --> 00:01:10,000
that you can extract request body data,

25
00:01:10,000 --> 00:01:12,000
and that you can send back responses

26
00:01:12,000 --> 00:01:15,000
with different status codes

27
00:01:15,000 --> 00:01:18,000
and also with different kinds of data.

28
00:01:18,000 --> 00:01:23,000
You'll learn about static API routes and dynamic API routes,

29
00:01:24,000 --> 00:01:28,000
and how you can structure your files and folders here.

30
00:01:28,000 --> 00:01:30,000
And with that, you got another important tool

31
00:01:30,000 --> 00:01:33,000
in your toolbox, which allows you to

32
00:01:33,000 --> 00:01:36,000
really build any kind of project

33
00:01:36,000 --> 00:01:38,000
and any kind of website you want

34
00:01:38,000 --> 00:01:42,000
because Next.js has all the features you need for that.

