The /api/search?superhero={name}
API endpoint allows you to request the full data from a superhero and display the results in its response.
Use a tool of your preferenance (postman, insomnia, etc) to execute the API requests.
- Note: Each successfull or failed response should be returned with its corresponding status code(eg: 2xx, 4xx, 5xx)
- Store the superhero search name together with the fullname of the superhero returned from the
superhero
API endpoint and a randomly generatedid
in thesearch.json
file. It's up to you to decide the format for storing the data in thesearch.json
file. - Create an API endpoint under
api/{path}/list
where it returns all the data stored insearch.json
file (our search list). - Create an API endpoint under
api/{path}/:id
where you can delete a superhero search record from thesearch.json
file based on its id.
- Validate the id passed on the endpoint's path before removing the record (eg:
abc
as id should not be accepted). - Add unit tests on your created endpoints for testing their functionality.