Usage: send a GET request to /insult/random/{name}
and the API will return a JSON object looking like this:
{
"status":"ok",
"insult":"{name} is a stupid asshat"
}
Here's a simple python program to get an insult for a name:
from requests import get
def insult(name: str):
result = get(f"http://localhost:8008/insult/random/{name}").json()
return result['insult']
print(insult("Bob"))
Retuns a list of endpoints.
Return an insult for a random name.
Return an insult for a name.
Return a list of insults for a name, to a maximum of 32.
Return an insult with 2 adjectives for a random name.
Return an insult with 2 adjectives for a name.
Return a list of insults with 2 adjectives for a name, to a maximum of 32.
- Make a copy of
docker-compose.example.yml
calleddocker-compose.yml
- Run
docker-compose up -d
- By default the server runs on port 8008, but this can be changed in
docker-compose.yml
More adjectives and nouns are always welcome to be added to data/random.json
, just add some and make a pull request.