So now we are going to be using the request object we have up in the function here.
So that's what you can use to pass in query parameters inside the original API request we have here,
we have this params tab and it has the top include facets and keyword parameters, query parameters
you call them.
So if I they're actually included in the URL up here, there's a question mark.
Then there's one query parameter here.
If I take it off, it disappears from the URL up here.
And so basically we are going to try and read those from the request we send to our own API and pass
it into the next Nordstrom API.
So the way to get these query parameters is to write like this.
So we say the top variable here, we call it number of.
Top and we'll say Rick request.
Dot query dot top.
So that's going to look in the query object inside of request and get the top parameter.
And then we have keyword.
And for the keyword we need to encode Uri encoded.
Which is what we can see it's going on here.
The space is being encoded as a percent 20.
So this is something you can call inside of JavaScript like encode component, and then we pass in the
query keyword parameter.
Now we can use these inside of a URL here.
So we do I will do make these into backticks instead so we can put in variables.
So I will take this instead of making it in hardcoded ten.
I will.
Put in a dollar sign and curly braces and write in number of top.
And for the keyword the same thing.
Dollar sign curly braces and write in key.
And I'm just going to rename this into keyword using F2.
So keyword instead.
And that's basically it.
So of course, you need to make sure that when you make a request, you set these parameters because
if you don't, it's not going to pass anything in here.
Maybe you could make something clever where you have defaults, but this is just a really simple example.
Let's try and see if it works.
So now in our local API, we need to pass in this query parameters.
Remember what we call them, we call it top and keyword.
It's basically the same as we did in the original API.
So let's call it top to get the free free results here.
Then we have keyword.
Let's call it red.
Red dresses.
And there we go.
So now we get the results for red dresses, the top three ones.
And let's see how the URL looks like just to make sure it is properly formatted.
I will do a console log URL.
I will make a request again.
And check out your looks.
Looks good.
We get the percent 20 just like you have in the original call.
So all is good now.
Now it's actually time for us to build the React app and start using this API we built inside of the
React app.