Evening is an Eve boilerplate project for rapid api deployment via .yaml
file configurations.
Install required python packages;
pipenv install
Activate your Pipenv;
pipenv shell
Run development server;
python manage.py runserver
First, create new .yaml
called book.yaml
in resources/
directory;
touch resources/book.yaml
Then edit file with the content below;
url: book
sorting: true
resource_methods:
- GET
- POST
- DELETE
item_methods:
- GET
- PATCH
- DELETE
schema:
name:
type: string
categoryId:
type: objectid
required: true
type:
type: string
allowed:
- bestseller
- low-price
- high-price
age:
type: number
max: 10
All set, now run development server with;
python manage.py runserver
Navigate to the Swagger UI;
http://127.0.0.1:5000/docs
You will see your book endpoints accordingly. You can check all configurations on /docs/resource-config.rst
file.
Build image with;
docker build -t evening-api .
Run container with port binding;
docker run -p 8000:8000 evening-api
Evening preconfigured with MongoDB instance specified in docker-compose.yml
file.
Simply run;
docker-compose up