https://github.com/liefland/idle_champions_codes_api
Web API - listing idle champions codes
https://github.com/liefland/idle_champions_codes_api
codes idle-champions idle-game
Last synced: 7 months ago
JSON representation
Web API - listing idle champions codes
- Host: GitHub
- URL: https://github.com/liefland/idle_champions_codes_api
- Owner: Liefland
- License: apache-2.0
- Created: 2024-01-26T22:30:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-09T13:11:08.000Z (over 1 year ago)
- Last Synced: 2025-03-07T03:38:14.114Z (about 1 year ago)
- Topics: codes, idle-champions, idle-game
- Language: Rust
- Homepage: https://codes.idlechampions.liefland.net/v1/codes
- Size: 101 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Idle Champion Codes
[](https://github.com/Liefland/idle_champions_codes_api/actions)
[](README#license)
Web API to list Idle Champions of the Forgotten Realms codes.
## Using it
#### Example: Consuming the API with curl and jq:
```bash
curl -s http://localhost:8000/v1/codes | jq '.codes | .[] | select(.expired == false).code'
```
#### Example: Adding a new code
```bash
curl -s -X PUT http://localhost:8000/v1/codes \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Api-Key: API_KEY' \
--data-binary @- << EOF
{"code": "HELL-OWOR-LD!!",
"expires_at": 1806038430,
"creator_name": "Foo!",
"creator_url": "https://foo.creator.bar",
"submitter_name": "Bar!",
"submitter_url": "https://bar.submitter.bar"}
EOF
```
## Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request.
To set up, we recommend the following:
- Familiarity with sqlx, rocket and postgresql are helpful.
- You will need a postgres service running, and that has the DB with migrations loaded: `db/migrations/*`
- Optionally, import the seeds too: `db/dev_seeds.sql`
- Create an env file at `.env` using the template file (`.env.template`),
- You might want to add a `Rocket.toml`
## License
Licensed under the following licenses at your option:
- Apache License, Version 2.0 <[LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0>
- MIT license <[LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT>
Files in the project may not be copied, modified, or distributed except according to those terms.