1
00:00:00,360 --> 00:00:02,980
In this video we are going to learn.

2
00:00:03,000 --> 00:00:09,170
API Gateway, HTTP API Core Concepts, Roots, Integration and States.

3
00:00:09,180 --> 00:00:14,910
These are the main core concepts and we can configure routes integration stage one creating an API Gateway

4
00:00:14,910 --> 00:00:16,320
HTTP API.

5
00:00:16,710 --> 00:00:24,900
Let's start with Roots API gateway use routes to expose integrations to consumers of our APIs routes

6
00:00:24,900 --> 00:00:28,200
direct incoming API request to backend resources.

7
00:00:28,650 --> 00:00:33,990
Routes consists of the two paths and HTTP method and source path.

8
00:00:33,990 --> 00:00:40,800
For example, get products so we can define specific HTTP method for our routes.

9
00:00:40,800 --> 00:00:46,800
Or we can also use any method to match all methods that we haven't defined for our resource.

10
00:00:46,800 --> 00:00:53,280
So we can create a default route that acts as a catch all for requests that don't match any other routes.

11
00:00:54,650 --> 00:00:57,680
Another core concept is pet variables.

12
00:00:58,070 --> 00:01:01,610
We can use pet variables in HTTP API routes.

13
00:01:01,640 --> 00:01:09,890
For example, if we designed the get product and slash product ID route, it will catch the gate request

14
00:01:09,890 --> 00:01:15,410
that a client submit to this product slash for example, ID six.

15
00:01:16,220 --> 00:01:23,210
And also we can specify a greedy pet variable, greedy pet variable case all child resources of a Roth.

16
00:01:23,240 --> 00:01:28,800
In order to create a greedy pet variable, we can add plus sign to the variable name.

17
00:01:28,820 --> 00:01:32,630
For example, you can see in here we can pull proxy plus.

18
00:01:32,630 --> 00:01:38,840
That means it is a greedy pet variable that cover and catch all child resources of lot.

19
00:01:39,080 --> 00:01:43,040
And another core concept is query setting parameters.

20
00:01:43,130 --> 00:01:48,950
By default, API Gateway sends query string parameters to all bacon integrations if they are included

21
00:01:48,950 --> 00:01:51,050
in a request to the HTTP API.

22
00:01:51,320 --> 00:01:59,240
For example, when a client send a request to the server, you can see in here we get to query setting

23
00:01:59,240 --> 00:01:59,960
parameter.

24
00:02:00,770 --> 00:02:07,070
In here, we get we get the ID and Typekit sitting parameters and sent to our integrations.

25
00:02:09,270 --> 00:02:12,160
So when a client sends an API request.

26
00:02:12,180 --> 00:02:19,920
API Gateway first determines which stage to route to the requester, and if the request explicitly match

27
00:02:19,920 --> 00:02:23,280
a stage API gateway sends the request to that stage.

28
00:02:23,520 --> 00:02:28,650
If no stage fully match the request API gateway sends the request to the default stage.

29
00:02:28,740 --> 00:02:32,910
If there is no default stage, then API Gateway returns message not fund.

30
00:02:33,510 --> 00:02:37,600
After selecting a stage API, Gateway selects a route API Gateway.

31
00:02:37,620 --> 00:02:43,980
Select the route with the most specific match using the following prices you can see in here.

32
00:02:43,980 --> 00:02:48,060
First of all, we will check full match of a route and method.

33
00:02:48,090 --> 00:02:54,870
We can see that if this is the full match of the route and method, this will be related to this method.

34
00:02:55,020 --> 00:03:00,340
And the second priority is match for the route and method with a greedy path variable.

35
00:03:00,360 --> 00:03:07,440
For example, this one, if the get product is match and the plus the slash one is not match, we can

36
00:03:07,440 --> 00:03:14,970
redirect to the these greedy pet variable definitions and if it is not match again in here, this will

37
00:03:14,970 --> 00:03:16,740
be the default route.

38
00:03:17,790 --> 00:03:23,280
So that means if no route match a request API get returns message not want to the client.

39
00:03:23,370 --> 00:03:25,810
For example, you can see the example on the slide.

40
00:03:25,830 --> 00:03:33,750
Consider that we can design a product API with the default stage and this will be following the example

41
00:03:33,750 --> 00:03:34,330
routes.

42
00:03:34,350 --> 00:03:41,470
First of all, this will look at this full match slash URL if there is no match.

43
00:03:41,490 --> 00:03:47,820
This will be look at the below one, look at the greedy path, look at the any method and greedy path.

44
00:03:47,820 --> 00:03:51,760
And if no match, there is a direction the default stage.

45
00:03:51,780 --> 00:03:56,640
If there is no default state, then there is a turning message, not want exception.

46
00:03:56,730 --> 00:04:00,660
So it is looking for the request fully match this search growth if not exist.

47
00:04:00,660 --> 00:04:03,360
Looking for the path parameters and proxy configuration.
