Skip to main content

WSGI compatibility for AWS API Gateway proxy resources

Project description

Makes Python WSGI apps compatible with AWS’ API Gateway proxy resources.

Example

from flask import Flask
import apigwsgi

app = Flask(__name__)

@app.route("/")
def index():
    return "Hello from Flask!"

handler = apigwsgi.Handler(app.wsgi_app)

Full example

Full example including deployment scripts can be found in the examples directory.

To deploy:

$ pip install boto3
$ examples/flask_handler/bin/deploy
[...]
Uploaded Flask example to https://xxxxx.execute-api.us-east-1.amazonaws.com/live/

When you’re done, remove it with:

$ examples/flask_handler/bin/destroy

Limitations

API Gateway doesn’t currently support binary responses, and will fail if your application sends non-unicode data.

See also

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apigwsgi-0.1.5.tar.gz (6.2 kB view details)

Uploaded Source

File details

Details for the file apigwsgi-0.1.5.tar.gz.

File metadata

  • Download URL: apigwsgi-0.1.5.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for apigwsgi-0.1.5.tar.gz
Algorithm Hash digest
SHA256 65263ae1fda17747d8208f451d6aac2342795cbcc1aee3bae6d800fbd9ddafd6
MD5 f11ce7a8def0df925f187e594268a5d6
BLAKE2b-256 6286f02223a386923a22312f728a1dac7be86e98fc82699b300e2733c7eda575

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page