Just a REST API app for CRUD’ ing informations related to League of Legends champions, written with Go. Demonstration video at Youtube can be found here
It will be updated for GraphQL and gRPC versions.
Before using, you must have Go and Docker. Of course there will be no data in database but don’t worry, you can fetch latest hero informations from LOL server with this repo
go get -u github.com/fukaraca/lol-champions-api
Dockerized MongoDB containers can be initialized from app folder with commands depending container status:
docker compose up or
docker compose start
Since our containers are running:
go run main.go
Ready to go…
You can Bash it or use POSTMAN. (Portal column at the table points to related POSTMAN tab eg params, headers, body, raw, json etc)
To retrieve hero list
If you want to check hero list:
Query Hero and Informations
You can query by two options. Sample query URL’s given in the table:
- Either query a hero with its name and take results of desired fields.For brevity, comma is used for seperation so repetition of
q=valsis not needed.
- Or make a conditional query by key, operand and value.
- First query URL returns
Spellsfor hero named
- Second query URL returns hero names who has
gt(greater than) 250
Field’s can be found at lib/model.go as json tagged. It is same as default LOL JSON return.
Operands for second query is same for MongoDB but with no $ sign. For example;
Create New Champion
You can use both raw JSON and Form-Data tab but for detailed creation JSON way must be picked.
|POST||http://localhost:8080/rest/champions/createWJSON||Body/raw – JSON|
Update Hero Informations
You can revoke, boost or nerf you favorite champion or change any field you want to. Total of 4 Body/form-data inputs are required.
name indicates hero name to be changed,
key is for field that will be modified,
op is operand obviously and
val is new value .
You can also delete any champion you want.