This is an illustration example of combining the async framework Tornado with async MongoDB driver Motor and Elasticsearch search engine.
The result presents a very simple and minimalistic restful API for creating news.
Features:
- Create news posts. See details about one or many post
- Paginated results
- Search posts
- Posts validation on creation
- docker-compose 1.11.2 or later
git clone https://github.com/dimmg/newsp.git
make start
SSH into the running newsp
container and start the server
docker exec -it newsp bash
python run.py
By having a running server, execute
docker inspect newsp
where IPAddress
it is the address of the running application.
To access the API navigate to http://{{IPAddress}}:5000
.
GET /news
- retrieve all postsGET /news/<news_uuid>
- retrieve specific postPOST /news
- create postGET /search
- search posts by subject and
** Note that this is a stub just for demonstration purposes. Many use cases have not been taken into consideration.