Closed RuanAragao closed 3 years ago
I can give it a shot. Please assign this to me.
I can give it a shot. Please assign this to me.
You can use this PR #10 for orientation.
I have a doubt. I am using the dynamic API routes. How are we going to navigate to the API route? I mean are we going to use a button to link to the API URL and passing the random number to the URL?
I have a doubt. I am using the dynamic API routes. How are we going to navigate to the API route? I mean are we going to use a button to link to the API URL and passing the random number to the URL?
You can use an API cliente for your tests, I use Insomnia. The API will be used, first, in the Good Luck Android App
Solved? Or I confused your doubt?
Okay, now I understood. So basically we will make a POST request from the "Good Luck Android App" to the API whose endpoint contains a random number and that random number will be generated using the random number generator function and we will pass it to the API URL. So I have to create a dynamic API route and a function in that which will fetch the random number from the query of the API URL and will return the JSON with the random number. Please correct me if I understood wrongly!
Yes, is correct!
We have a random number generator (pages/api/utils/random-number.ts) and we need to return a value from it in endpoint
/api/number
(/pages/api/number.ts).The number must be 8 digits.
Eg: