This app is used to create an API for many Crous restaurants in Strasbourg.
- π Docker
- π§ Normal Setup with Python
- π Launch with Python
- π How to use it
- π Bugs and TODO
A Docker file is provided to make the installation easier. You NEED to create configuration file name .env
(you can use the .env.example
file as a template) :
# URL of the API
HOST=0.0.0.0
# URL of the ILLKIRCH menu website
ILLKIRCH=
# URL of the CRONENBOURG menu website
CRONENBOURG=
# URL of the PAUL APPELL menu website
PAUL_APPELL=
# URL of the Esplanade menu website
ESPLANADE=
# URL of the Gallia menu website
GALLIA=
To use it, you can build the Docker image an runing it :
docker build -t api-menu-crous .
docker run -p <WANTED_PORT>:5000 --env-file .env -d api-menu-crous
Or you can use the Docker image from the Docker Hub :
docker pull ghcr.io/loskeeper/api-menu-crous-docker:latest
docker run -p <WANTED_PORT>:5000 --env-file .env -d ghcr.io/loskeeper/api-menu-crous-docker:latest
Many libraries are needed to make this bot work :
pip install -r requirements.txt
If you have some troubles with the installation of the
pycurl
library, make sure to have installed thelibcurl4-openssl-dev
and thelibssl-dev
packages :sudo apt install libcurl4-openssl-dev libssl-dev
To configure the api, you need to create configuration file name .env
(you can use the .env.example
file as a template) :
# URL of the API
HOST=
# URL of the ILLKIRCH menu website
ILLKIRCH=
# URL of the CRONENBOURG menu website
CRONENBOURG=
# URL of the PAUL APPELL menu website
PAUL_APPELL=
# URL of the Esplanade menu website
ESPLANADE=
# URL of the Gallia menu website
GALLIA=
To launch the bot, you need to run the main.py
file :
python3 main.py
To use it, you need to connect to the API URL you have configured in the .env
file with the port 5000. The accessibles URL are :
/
: Display the available routes/illkirch
: Display the menu of the ILLKIRCH restaurant/cronenbourg
: Display the menu of the CRONENBOURG restaurant/paul-appell
: Display the menu of the PAUL APPELL restaurant/esplanade
: Display the menu of the ESPLANADE restaurant/gallia
: Display the menu of the GALLIA restaurant
An example of the output for the /illkirch
route can be find in the example.json
file.
- Add threads to make the answer faster