https://github.com/nikos/rest_api_demo_elasticsearch
Sample RESTful web application with Flask + Swagger, plus persisting model in Elasticsearch
https://github.com/nikos/rest_api_demo_elasticsearch
Last synced: 3 months ago
JSON representation
Sample RESTful web application with Flask + Swagger, plus persisting model in Elasticsearch
- Host: GitHub
- URL: https://github.com/nikos/rest_api_demo_elasticsearch
- Owner: nikos
- Created: 2017-02-23T07:09:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-10T21:23:21.000Z (over 2 years ago)
- Last Synced: 2025-01-13T06:22:09.712Z (4 months ago)
- Language: Python
- Size: 14.6 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rest_api_demo_elasticsearch [](https://travis-ci.org/nikos/rest_api_demo_elasticsearch) [](https://microbadger.com/images/nikos/flask-restplus-demo)
This repository contains boilerplate code for a RESTful API based on Flask and Flask-RESTPlus in Python.
The code of this demo app is described in an article on my blog:
http://michal.karzynski.pl/blog/2016/06/19/building-beautiful-restful-apis-using-flask-swagger-ui-flask-restplus/It makes use of:
* Python 3
* Flask
* Swagger UI (via `restplus`)
* Simple model (thanks to `elasticsearch-dsl`)
* Alpine Linux (if running as a docker container)## Getting Started
Either build and run with the help of the provided Dockerfile
```
make build
make run
```
and open up your browser on http://localhost:8000/api/ to see the
Swagger UI and interact with the REST endpoints.Or run it locally by executing:
```
export PYTHONPATH=.:rest_api_demo
python3 rest_api_demo/app.py
```See corresponding elasticsearch documents by opening Kibana:
open http://localhost:5601/