1
00:00:03,820 --> 00:00:04,540
Hey, welcome back.

2
00:00:04,570 --> 00:00:08,620
This is my solution to the current task of building a simple API.

3
00:00:08,650 --> 00:00:10,990
So that's my main dot pi file.

4
00:00:13,260 --> 00:00:22,170
It takes care of two routes the home page routing and the URL pattern routing of the API.

5
00:00:22,200 --> 00:00:24,510
So the home page renders the home.

6
00:00:24,510 --> 00:00:30,090
That HTML document which is hosted in my templates folder and it looks like this.

7
00:00:31,170 --> 00:00:33,810
And on the front end it looks like this.

8
00:00:34,930 --> 00:00:38,590
So that's the home that documents and when the user visits.

9
00:00:40,340 --> 00:00:44,690
A you have to get the API response like that.

10
00:00:45,800 --> 00:00:53,090
I return this dictionary with the words capitalized, so any word that the user enters here is capitalized.

11
00:00:53,090 --> 00:00:57,770
And I did that using this API function.

12
00:00:58,550 --> 00:01:02,390
So the user's word goes in here and then it goes in here.

13
00:01:02,390 --> 00:01:06,780
And from there goes here and here it is uppercase.

14
00:01:06,800 --> 00:01:13,640
It's capitalized using the upper method, which capitalizes all the letters of a string.

15
00:01:14,840 --> 00:01:17,270
The result is saved in the definition variable.

16
00:01:17,270 --> 00:01:21,850
And then I serve the definition variable to this dictionary here.

17
00:01:21,890 --> 00:01:25,490
So I constructed the dictionary and then I returned the dictionary.

18
00:01:25,760 --> 00:01:32,990
And when the users visit this URL, that's what they see that dictionary and that's it.

19
00:01:33,410 --> 00:01:37,040
Then I serve this in the sport.

20
00:01:37,040 --> 00:01:38,270
5001.

21
00:01:39,260 --> 00:01:41,930
And that's a complete code for this exercise.

22
00:01:44,410 --> 00:01:51,100
In the next day, we're going to serve the actual definition of any words, and for that we're going

23
00:01:51,100 --> 00:01:53,170
to use some data.

24
00:01:54,540 --> 00:01:55,980
So let's talk back tomorrow.

