Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dimmg/newsp
Minimalistic API using Tornado, Motor and Elasticsearch
https://github.com/dimmg/newsp
elasticsearch motor python tornado
Last synced: about 1 month ago
JSON representation
Minimalistic API using Tornado, Motor and Elasticsearch
- Host: GitHub
- URL: https://github.com/dimmg/newsp
- Owner: dimmg
- Created: 2017-08-14T11:25:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-06-01T22:07:47.000Z (over 3 years ago)
- Last Synced: 2023-02-27T17:45:42.521Z (almost 2 years ago)
- Topics: elasticsearch, motor, python, tornado
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# newsp
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
### Prerequisites
- docker-compose 1.11.2 or later
### Usage
#### Clone the repository
```
git clone https://github.com/dimmg/newsp.git
```#### Build and run docker images
```
make start
```#### Run application
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`.
#### Endpoints
- `GET /news` - retrieve all posts
- `GET /news/` - retrieve specific post
- `POST /news` - create post
- `GET /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._