gunicorn/examples/frameworks/flaskapp_aiohttp_wsgi.py
Benoit Chesneau 95b7ffeeaa chore: prepare release 25.0.2
- Bump version to 25.0.2
- Update copyright year to 2026 in LICENSE and NOTICE
- Add license headers to all Python source files
- Add changelog entry for 25.0.2
2026-02-06 08:21:18 +01:00

29 lines
607 B
Python

#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
# Example command to run the example:
#
# $ gunicorn flaskapp_aiohttp_wsgi:aioapp -k aiohttp.worker.GunicornWebWorker
#
from aiohttp import web
from aiohttp_wsgi import WSGIHandler
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello, world!'
def make_aiohttp_app(app):
wsgi_handler = WSGIHandler(app)
aioapp = web.Application()
aioapp.router.add_route('*', '/{path_info:.*}', wsgi_handler)
return aioapp
aioapp = make_aiohttp_app(app)