https://github.com/lalugue/dice-api
A small and fun API for virtual dice rolling needs 🎲
https://github.com/lalugue/dice-api
dice fastapi python
Last synced: 3 months ago
JSON representation
A small and fun API for virtual dice rolling needs 🎲
- Host: GitHub
- URL: https://github.com/lalugue/dice-api
- Owner: lalugue
- License: apache-2.0
- Created: 2022-05-16T13:07:23.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-15T10:57:44.000Z (almost 4 years ago)
- Last Synced: 2025-01-11T10:16:23.860Z (over 1 year ago)
- Topics: dice, fastapi, python
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# dice-api
A small and fun API for virtual dice rolling needs 🎲
For a sample roll, try the following locally:
```
http://127.0.0.1:8000/dice/
```
To roll one's own set of dice, use the `dice` query parameter, for example:
```
http://127.0.0.1:8000/dice/?dice=d4,d6,d6
```
Valid dice include:
```
d4,d6,d8,d10,d12,d20
```
# Installation
Install the required libraries whether in the host itself or in a virtual machine:
```
pip install -r requirements.txt
```
# Run
Run the application with the following command:
```
uvicorn main:app --reload
```
To run without reloading after code changes, remove the `--reload` option
# Documentation
Auto-generated and interactive list of available routes is located at `/docs`, for example:
```
http://127.0.0.1:8000/docs
```
# Test
Run `pytest` to run tests
```
pytest
```