1
0
Fork 1
mirror of https://github.com/MingweiSamuel/Riven.git synced 2025-04-11 08:23:16 -07:00

fixup! docs: fix bare links, test docs in CI, regen

This commit is contained in:
Mingwei Samuel 2025-03-18 16:18:15 -07:00
parent f8749d06d6
commit 25ea7b5b57
3 changed files with 11 additions and 10 deletions
.github/workflows
riven/examples/proxy
test-wasm.bash

View file

@ -42,7 +42,7 @@ jobs:
- run: cargo test --no-fail-fast --features riven/nightly,riven/deny-unknown,riven/eserde,riven/__proxy
- name: Install `wasm-pack`
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- run: wasm-pack test --node -- --features riven/nightly,riven/deny-unknown,riven/eserde
- run: wasm-pack test --node -- --features nightly,deny-unknown,eserde
working-directory: riven
lints:

View file

@ -11,21 +11,22 @@ with bodies, however it does not handle RSO endpoints which require an
failure information. Rate limits are enforced, so requests will wait to complete
when Riven is at the rate limit.
Set `RGAPI_KEY` env var then run:
Put your API key into either the `RGAPI_KEY` environment variable or the `apikey.txt`
file, then run the proxy:
```bash
export RGAPI_KEY=RGAPI-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
cargo run --example proxy
cargo run --example proxy --features riven/__proxy
```
Test in your browser or using `curl`. The first path segment specifies the region:
```json
$ curl http://localhost:3000/na1/lol/summoner/v4/summoners/by-name/LugnutsK
{"id":"...","accountId":"...","puuid":"...","name":"LugnutsK","profileIconId":4540,"revisionDate":1589704662000,"summonerLevel":111}
```bash
$ curl http://localhost:3000/americas/riot/account/v1/accounts/by-riot-id/LugnutsK/000
{"puuid":"...","gameName":"LugnutsK","tagLine":"000"}
$ curl http://localhost:3000/eu/val/status/v1/platform-data
{"id": "EU", "name": "Europe", "locales": ["..."], "maintenances": [], "incidents": []}
$ curl http://localhost:3000/americas/lol/tournament-stub/v5/providers -H "Content-Type: application/json" -d '{"region":"JP","url":"https://github.com/MingweiSamuel/Riven"}'
$ curl http://localhost:3000/americas/lol/tournament-stub/v5/providers \
-H "Content-Type: application/json" -d '{"region":"JP","url":"https://github.com/MingweiSamuel/Riven"}'
1
$ curl http://localhost:3000/na1/unknown/endpoint

View file

@ -6,7 +6,7 @@ export RGAPI_KEY="$(cat apikey.txt)"
cd riven
# Ensure builds with tracing, metrics.
wasm-pack build -- --features riven/nightly,riven/tracing,riven/metrics
wasm-pack build -- --features nightly,tracing,metrics
# Run tests.
wasm-pack test --node -- --features riven/nightly,riven/deny-unknown,riven/eserde
wasm-pack test --node -- --features nightly,deny-unknown,eserde