-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancements to aiohttp.web #5
Comments
from rororo.aio.routes import add_route_context
from . import api as api_views
app = Application(...)
with add_route_context(app, api_views, '/api', 'api') as add_route:
add_route('GET', '/', 'index')
add_route('POST', '/posts', 'add_post')
add_route('GET', '/posts', 'list_posts') This should create 3 route handlers,
|
from pathlib import Path
from rororo.aio.routes import add_static_context
rel = Path(__file__).dirname
app = Application(...)
static_dir = rel / '..' / 'static'
with add_static_context(app, static_dir) as add_static:
add_static('/favicon.ico', 'images/favicon.ico')
add_static('/static') This should create 2 static route handlers,
|
Greetings! I hope you don't mind, but I adapted your I made a few changes to make the following possible:
See the examples here: https://aiohttp-utils.readthedocs.org/en/latest/modules/routing.html#aiohttp_utils.routing.add_route_context I'd be glad to contribute them to rororo if you'd like. |
Greetings! Great to hear about
|
There are several desired enhancements to
aiohttp.web
library that widely used in backend applications which should be added torororo
,Application
to support debug mode and proper logging while serving with gunicornadd_route
context managerThe text was updated successfully, but these errors were encountered: