A Pokemon List API
This is DotNet Web API example that get its pokemon data from a remote API and caches it using Redis in order to deliver a full working solution of distributed application using dotnet core 2.0.
You're going to need Redis, I'm using an Docker image myself and you can get one by running:
docker run -d --name myRedis -p 6379:6379 redis
You can get your development env running by following these steps:
Get the code
git clone [email protected]:davidsellen/pokemoncoreapi.git
Restore dotnet packages
dotnet restore
Run the Application
dotnet run
Navigate to http://localhost:5000/api/pokemon to get a list of pokemons
Navigate to http://localhost:5000/api/pokemon/1 to get a single pokemon
using docker follow these steps:
docker-compose build
docker-compose up
now browse to http://localhost:8080/api/pokemon/ and see the JSON output of:
[{"id":1,"name":"bulbasaur"},{"id":2,"name":"ivysaur"},{"id":3,"name":"venusaur"},{"id":4,"name":"charmander"},{"id":5,"name":"charmeleon"},{"id":6,"name":"charizard"},{"id":7,"name":"squirtle"},{"id":8,"name":"wartortle"},{"id":9,"name":"blastoise"},{"id":10,"name":"caterpie"},{"id":11,"name":"metapod"},{"id":12,"name":"butterfree"},{"id":13,"name":"weedle"},{"id":14,"name":"kakuna"},{"id":15,"name":"beedrill"},{"id":16,"name":"pidgey"},{"id":17,"name":"pidgeotto"},{"id":18,"name":"pidgeot"},{"id":19,"name":"rattata"},{"id":20,"name":"raticate"}]
- Redis - For distributed caching
- DotNetCore - Web server
- Docker - Ship web server and caching server as containers
- David Santos - Initial work - DavidSantos
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
-
This API cosumes its pokemons from https://pokeapi.co
-
Used some ideas by @renatogroffe net-core-2-exemplos
-
Usefull tips config docker compose by @alirizaadiyahsi docker-web-farm-example