A REST API (only GET requests) for an unknown purpose...
- Python 3.6+
- Flask
- pytest (for testing)
Assumption: python points to python3
- Install poetry
by
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
in Linux/MacOS - in Windows
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python
- If not interested in running tests and installing additional dev tools, run instead
poetry install --no-dev
below
git clone https://github.com/nicolaskyejo/maji_ya_mchicha.git
cd maji_ya_mchicha
poetry install
poetry shell
cd flask_app
flask run
git clone https://github.com/nicolaskyejo/maji_ya_mchicha.git
cd maji_ya_mchicha
python -m venv backend
$ source backend/bin/activate
$ pip install -r requirements.txt # requirements-dev.txt if you want to run tests
$ cd flask_app
$ flask run
PS > backend\scripts\activate.ps1
PS > pip install -r requirements.txt # requirements-dev.txt if you want to run tests
PS > cd flask_app
PS > flask run
Navigate to tests directory
cd tests
pytest
Requests are sent to localhost:5000/restaurants/search
Parameters:
- q = query string
- lat = latitude
- lon = longitude
You can send requests using postman, your web browser, or cURL
curl 'http://127.0.0.1:5000/restaurants/search?q=veg&lat=60.17&lon=24.94'