项目作者: manoveg

项目描述 :
Example flask application using Zalando's connexion and swagger
高级语言: Python
项目地址: git://github.com/manoveg/connexionexampleapp.git
创建时间: 2018-11-20T22:30:31Z
项目社区:https://github.com/manoveg/connexionexampleapp

开源协议:

下载


Example flask connexion application

Application tech stack

  • python 3.6
  • Flask
  • Tornado
  • connexion
  • OpenAPI

Description

This application uses Zalando’s connexion to make a Flask web app based on
Swagger/OpenAPI .

url: https://github.com/zalando/connexion

Advantages:

  • simplify the development process
  • confirm expectations about what your API will look like
  • Keeps Api documentation up to date
  • Client code can be generated

Steps to run the application

Running locally

  • $ pipenv install —dev && pipenv shell
  • $ python app.py

Open UI for swagger

http://localhost:8080/ui/

Running with Docker

from the application root directory

  • docker build -t connexionexampleapp .
  • docker run -d -p 8080:8080 connexionexampleapp

  • On linux application should be available on localhost

  • On Mac look for the ip address generated by Docker & use that

API endpoints

To use the api to detect ip address and return PM10 values

To pass ipv6 address as parameter to get corresponding PM10 values
http://localhost:8080/getpm10values/

example

  • 97bf:e753:c122:239:d2f9:a6f6">http://localhost:8080/getpm10values/2a02:8109:97bf:e753:c122:239:d2f9:a6f6