mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-02-06 22:50:52 +03:00
17 lines
313 B
Python
17 lines
313 B
Python
|
"""Web application module."""
|
||
|
|
||
|
from flask import Flask
|
||
|
|
||
|
|
||
|
def create_app(name, routes):
|
||
|
app = Flask(name)
|
||
|
for route in routes:
|
||
|
app.add_url_rule(*route.args, **route.kwargs)
|
||
|
return app
|
||
|
|
||
|
|
||
|
class Route:
|
||
|
def __init__(self, *args, **kwargs):
|
||
|
self.args = args
|
||
|
self.kwargs = kwargs
|