excusemyfrench is the application beyond https://excusemyfrench.herokuapp.com/
-
Create a virtual environment and install dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt -
Run the application locally:
export PORT=5000 python3 app.pyThe app will be available at
http://localhost:5000/.
To run the unit tests, simply execute:
python3 test_app.pywill return you a random French insult
https://excusemyfrench.herokuapp.com/
will include not only a random French insult *but also* a random picture of an authentic French person.
https://excusemyfrench.herokuapp.com/img
will include a specific insult/picture (based of the index in fixed tables)
https://excusemyfrench.herokuapp.com/img/<number>/<number> like https://excusemyfrench.herokuapp.com/img/127/1
will refresh automatically the insult ( with image ) every second
https://excusemyfrench.herokuapp.com/series
will return a JSON response of the insult ( see [Detail of the API] )
https://excusemyfrench.herokuapp.com/api
Returns json data of a single insult.
- URL:
/api/v1 - Method:
GET - Success Response:
- Code: 200
Content:
{ "insult": { "text": "Playboy De Superette" , "index": 356 } }
- Code: 200
Content:
Returns json data of an insult and the base64 encoded image
- URL:
/api/v1/img - Method:
GET - Success Response:
- Code: 200
Content:
{ "insult": { "text": "Loutre Analphabète", "index": 254 }, "image": { "data": "/9j/4AA*****", "mimetype": "image/jpg", "indexImg": 10 } }
- Code: 200
Content: