- Author: Héctor Franco
- website: https://hectorfranco.dev
- email: contact@hectorfranco.dev
- Last edit: Dec 10th 2023
- Postman Documentation: Postman API Production
- Server on Production mode: https://backend-pokedex-technical-test.onrender.com/
Before executing this server, you must setup correctly the project. Follow the steps down below to configure the server.
$bash: python3 -m venv venv
$bash: source venv/bin/activate
cmd: .\venv\scripts\activate
$bash pip install -r requirements.txt
Create an .env file at the root of the project with the environment variable. See .env.example file
$bash: python3 app.py
After that, a local server will start running on http://127.0.0.1:5000
This API provides access to data about Pokémon from the official Pokémon API.
- Description: Retrieves a list of all Pokémon.
- Parameters:
limit
: (Optional) Number of Pokémon to retrieve (default: 20).offset
: (Optional) Number from looking for Pokemon.
- Response:
results
: Array of objects containing basic Pokémon data: name and URL (resource).
- Description: Retrieves data for a specific Pokémon.
- Parameters:
name
: The ID or the name of the Pokémon.
- Response:
JSON
: Object containing detailed Pokémon information: id, name, types, abilities, sprites.
Get the first 20 Pokemon
$bash: curl -X GET http://localhost:5000/api/pokemon
Get the first 40 Pokemon
$bash: curl -X GET http://localhost:5000/api/pokemon?limit=40
Starts brining the list since the Pokemon #15 (15 to 35)
$bash: curl -X GET http://localhost:5000/api/pokemon?offset=15
Brings 10 Pokeomon starting at position #40 (40 to 50)
$bash: curl -X GET http://localhost:5000/api/pokemon?limit=10&offset=40
$bash: curl -X GET http://localhost:5000/api/pokemon/1
Unit tests can be found at src.tests. Here are the steps to running them.
$bash: pip3 install pytest
Unittest should be installed before and can be execute as a module
$bash: pytest
$bash: python3 -m unittest