Skip to main content

Chaos Middleware Flask integration

CI Python versions

Install

This package requires Python 3.5+

$ pip install -U proofdock-chaos-middleware-flask

Usage

The chaos middleware for Flask takes the following input variables:

Variable Description
CHAOS_MIDDLEWARE_APPLICATION_NAME The service application's name
CHAOS_MIDDLEWARE_APPLICATION_ENV The service application's deployed environment
CHAOS_MIDDLEWARE_PROOFDOCK_API_TOKEN The API token to connect to Proofdock's Chaos API

The configuration exemplified as code:

from flask import Flask, jsonify
from pdchaos.middleware.contrib.flask.flask_middleware import FlaskMiddleware

app = Flask(__name__)
app.config['CHAOS_MIDDLEWARE_APPLICATION_NAME'] = 'example-application-name'
app.config['CHAOS_MIDDLEWARE_APPLICATION_ENV'] = 'example-environment'
app.config['CHAOS_MIDDLEWARE_PROOFDOCK_API_TOKEN'] = 'eyJ0eXAi...05'

middleware = FlaskMiddleware(app)

# Your business logic here

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

References

Release files for proofdock-chaos-middleware-flask 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for proofdock-chaos-middleware-flask 0.1.3
File Interpreter ABI Platform
proofdock_chaos_middleware_flask-0.1.3-py3-none-any.whl Python 3 none any Details

Release files / proofdock_chaos_middleware_flask-0.1.3-py3-none-any.whl

Download URL proofdock_chaos_middleware_flask-0.1.3-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
935a06583c30ec6bbc73a32614598803109047665cac0e34022b3571be7c5f5d
BLAKE2b-256 checksum
How to use checksums
f0f077462ed687c7499a500e5451d48a45e295bfe761345390eea47c8d580d51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page