Microservice for fetching Pokémon data.
Elixir v1.18.0
Install dependencies:
mix deps.getStart the server:
mix run --no-haltThe application will start on http://localhost:8080.
If you prefer to run this service in a Docker container, you can do so by following these steps:
Build the Docker image:
docker build -t pokedex_api .Run the Docker container:
docker run -p 8080:8080 pokedex_api-
Get Pokemon by ID
- URL:
/api/v1/pokemon/{id} - Method:
GET - Description: Fetches information about a Pokemon by its ID.
- URL:
-
Get Pokemon by Name
- URL:
/api/v1/pokemon?name={name} - Method:
GET - Description: Fetches information about a Pokemon by its name.
- URL:
-
Fetch Pokemon by ID:
curl -X GET "http://localhost:8080/api/v1/pokemon/25" -
Fetch Pokemon by Name:
curl -X GET "http://localhost:8080/api/v1/pokemon?name=Pikachu"
This project also includes support for GraphQL.
- URL:
/graphql - Method:
POST - Description: Endpoint to handle GraphQL queries.
- Query Pokemon by ID:
query {
pokemon_by_id(id: 25) {
id
name
types
# Add more fields here
}
}- Query Pokemon by Name:
query {
pokemon_by_name(name: "Pikachu") {
id
name
types
# Add more fields here
}
}