This project is a sandbox and can be used as a basis for workshops or training sessions, such as RxJS or ComponentStore.
This playground gives you a simple page with some available APIs. Models and http services are ready, all business logic can be implemented!
npm ci
npm start
A mocked backend is automatically started when running npm start
. It offers some API:
GET /api/languages
returns a list of supported languages.
Example:
["ja","ko","zh","fr","de","es","it","en","cs"]
GET /api/types
return a list of PokemonType
.
Example:
[
{
"id": "1",
"name": "Normal"
},
{
"id": "2",
"name": "Fighting"
},
{
"id": "3",
"name": "Flying"
}
]
It support querying with a lang
to translates entities:
// GET /api/types?lang=fr
[
{
"id": "1",
"name": "Normal"
},
{
"id": "2",
"name": "Combat"
},
{
"id": "3",
"name": "Vol"
}
]
GET /api/pokemons
return a PokemonCollection
.
Example:
{
"count": 1017,
"items": [
{
"id": "1",
"name": "Bulbasaur",
"description": "Seed Pokémon",
"image": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png"
},
{
"id": "2",
"name": "Ivysaur",
"description": "Seed Pokémon",
"image": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/2.png"
},
{
"id": "3",
"name": "Venusaur",
"description": "Seed Pokémon",
"image": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/3.png"
}
]
}
It support querying with:
lang
to translates entitiestypeId
to return only Pokemons of provided typesearch
to return only Pokemons with matching namelimit
to return only<limit>
results (default to 20 items)page
to return then
th page (starting from 1)
// GET /api/pokemons?lang=fr&typeId=10&page=2&search=s&limit=3
{
"count": 19,
"items": [
{
"id": "156",
"name": "Feurisson",
"description": "Pokémon Volcan",
"image": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/156.png"
},
{
"id": "157",
"name": "Typhlosion",
"description": "Pokémon Volcan",
"image": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/157.png"
},
{
"id": "228",
"name": "Malosse",
"description": "Pokémon Sombre",
"image": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/228.png"
}
]
}