Liine Python API task
To run locally:
- Install the requirements
pip install uvicorn fastapi
- Run the following command from the /app directory
uvicorn main:app --reload
- GET requests can be made to
(http://127.0.0.1:8000/restaurants/{datetime})
The datetime should be in the formatYYYY-MM-DDTHH:MM:SS
- Access the swagger documentation at
(http://127.0.0.1:8000/docs#/)
Docker:
- Build the docker image using the following command
docker build -t liine-py .
- Run the docker container using the following command
docker run -d --name liine-app1 -p 8000:8000 liine-py
- GET requests can be made to
(http://127.0.0.1:8000/restaurants/{datetime})
The datetime should be in the formatYYYY-MM-DDTHH:MM:SS
- Access the swagger documentation at
(http://127.0.0.1:8000/docs#/)
Tests:
- Run the tests using the following command
python -m unittest test_restaurant_data.py