1
00:00:00,300 --> 00:00:05,280
In this video, we are going to test our exposing APIs from the API gateway.

2
00:00:05,460 --> 00:00:10,950
Basically, we didn't implement the actual Lambda function code, but at least we will verify that our

3
00:00:10,950 --> 00:00:13,710
synchronous architecture is working fine or not.

4
00:00:14,070 --> 00:00:22,080
So if you open the mission console in the last video we can see invoke will appear on top of this page.

5
00:00:22,110 --> 00:00:25,800
We will try accessing this URL from the browser or postman.

6
00:00:25,950 --> 00:00:29,670
So for that purpose I'm going to open the code.

7
00:00:29,700 --> 00:00:35,910
You can see that we will perform these get post operations using this URL and we will perform, get

8
00:00:35,910 --> 00:00:40,050
put and delete operations using the product by ID invocation URL.

9
00:00:40,140 --> 00:00:41,490
So let's get started.

10
00:00:41,490 --> 00:00:49,830
So please open the postman and we will follow these methods one by one, and I'm going to select the

11
00:00:49,830 --> 00:00:50,370
first.

12
00:00:52,040 --> 00:00:54,290
And perform, get and post operation.

13
00:00:54,320 --> 00:00:59,150
To do that, please open the postman and put the URL in here.

14
00:00:59,180 --> 00:01:03,380
Make sure that you are sending the easy to get method and click the send button.

15
00:01:04,550 --> 00:01:08,000
As you can see that these return back from the lambda function.

16
00:01:08,000 --> 00:01:14,060
That means API gateways successfully redirect our function request to the lambda function and we will

17
00:01:14,060 --> 00:01:16,430
follow the same step for the post operation.

18
00:01:19,200 --> 00:01:23,370
For example, if there is a problem, you can randomly change this name.

19
00:01:23,370 --> 00:01:27,980
And if scientists request, you can see this exemption missing authentication exemption.

20
00:01:27,990 --> 00:01:35,330
So that's why we have verified every URL is working and invoking our lambda function properly or not.

21
00:01:35,340 --> 00:01:38,850
So please follow the same thing for the post operation.

22
00:01:38,850 --> 00:01:45,330
In the post operation, the method should be paused and we should select the body role and this should

23
00:01:45,330 --> 00:01:46,230
be the JSON.

24
00:01:46,230 --> 00:01:53,580
We can get the JSON object from our documentation and copy from here and paste in here and click the

25
00:01:53,580 --> 00:01:54,390
send button.

26
00:01:54,390 --> 00:02:00,750
See that we see the exact same error because our lambda function didn't perform in action.

27
00:02:00,750 --> 00:02:06,600
Now only return back to our hello from Lambda Message, but at least we verified that this post operation

28
00:02:06,600 --> 00:02:07,800
working successfully.

29
00:02:07,890 --> 00:02:12,900
So if you continue the other methods you can come here and copy this.

30
00:02:13,770 --> 00:02:17,280
So at this time we will send to get put until it.

31
00:02:17,280 --> 00:02:25,980
But providing these ID information in order to do that please exposing any method and give random product

32
00:02:25,980 --> 00:02:26,910
ID in here.

33
00:02:26,910 --> 00:02:30,540
So this is the product by ID with a certificate, click the send button.

34
00:02:30,540 --> 00:02:33,060
See that it is record the lambda function.

35
00:02:33,060 --> 00:02:40,230
So let me quote paste in here and again this time we will provide the HTTP put operation to update our

36
00:02:40,230 --> 00:02:40,680
operation.

37
00:02:40,680 --> 00:02:42,570
Let me send for now.

38
00:02:42,570 --> 00:02:50,010
Yes, it is also working now the last thing we should do that again product by ID but the method should

39
00:02:50,010 --> 00:02:55,950
be the http delete and click the send button and verify that our lambda function is triggered successfully.

40
00:02:56,100 --> 00:03:03,270
So also we can check the lambda function execution log open the lambda and go to lambda function, go

41
00:03:03,270 --> 00:03:04,080
to monitoring.

42
00:03:04,080 --> 00:03:10,500
And we've enclosed Deutsch logs and verify that these invocations happens and seem in the cloud logs.

43
00:03:10,500 --> 00:03:15,750
If you open the latest log stream and come to here, you can see the different request.

44
00:03:15,780 --> 00:03:22,980
Invoke our lambda function at the last invocation comes from the HTTP delete method and the resource

45
00:03:22,980 --> 00:03:26,520
is product by ID the ID name is the pet is one.

46
00:03:26,520 --> 00:03:28,080
We can see the pet variables.

47
00:03:28,080 --> 00:03:31,380
Also see the pet variables id a cool one.

48
00:03:31,380 --> 00:03:33,420
So that means product ID is one.

49
00:03:33,540 --> 00:03:41,070
So as you can see that we have successfully test our execution in location URLs from the API gateway.

50
00:03:41,100 --> 00:03:47,970
Now it is time to develop start to develop product microservices using a SDK for JavaScript version

51
00:03:47,970 --> 00:03:48,330
three.
