The Wayback Machine - https://web.archive.org/web/20190115061551/https://github.com/ssola/python-flask-microservice
Skip to content
Skeleton of a Microservice built with the Flask
Clone or download
ssola Merge pull request #1 from laranicolas/master
Fix: Connexion app only receive two arguments.
Latest commit 0777fb0 May 29, 2017

README.md

python-flask-microservice

This is the code used in this series of articles:

This is a basic approach of building a Microservice on top of Flask, with some useful packages like:

Requirements

We are going to build a microservice to index rooms information coming from another service (crawler). This service will be responsible for indexing the information into Elasticsearch.

The indexing will be a process of:

  • Validate and sanitize the data
  • Get some metadata from the room information like geolocalization
  • Upload the given images URL to Amazon S3
  • Send an event to RabbitMQ every time a new room has been indexed serializing the payload with Avro.

Endpoints:

Method URI Description Status
POST /room it will receive the room payload, and it will proceed to index it Development
PATCH /room/{id} this PATCH method will allow us to make changes on the indexed item Not started
DELETE /room/{id} this method will remove the room from the index Not started
GET /room/{id} this method will return the room data for a given room id Not started
GET /health-check This endpoint retuns the state of the service Not started

Running the environment

You need to have Docker installed in your machine, after that, just run this command docker-compose build && docker-compose up -d.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.