This is a Pokedex API created in Ruby on Rails, using the Pokemon API. It has two models, Pokemon and Types, with association between both.
bundle installrails db:createrails db:migraterake import:import_pokemonapi/v1/pokemons
Show a list of all pokemons.
Example local: localhost:3000/api/v1/pokemons
-200 Success
[
{
"id": 1,
"name": "bulbasaur",
"order": 1,
"base_experience": 64,
"height": 7,
"weight": 69,
"created_at": "2023-11-07T23:10:13.280Z",
"updated_at": "2023-11-07T23:10:13.280Z",
"pokemon_types": [
{
"slot": 1,
"type": {
"name": "grass"
}
},
{
"slot": 2,
"type": {
"name": "poison"
}
}
]
},
{
"id": 2,
"name": "ivysaur",
"order": 2,
"base_experience": 142,
"height": 10,
"weight": 130,
"created_at": "2023-11-07T23:10:13.385Z",
"updated_at": "2023-11-07T23:10:13.385Z",
"pokemon_types": [
{
"slot": 1,
"type": {
"name": "grass"
}
},
{
"slot": 2,
"type": {
"name": "poison"
}
}
]
}]
api/v1/pokemons/new
Creates pokemon with name, order, base_experience, height, weight and pokemon_types_attributes. Name and order are required (validates with presence and uniqueness).