mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
I now call a factory function to construct the Sanic app:
app = app_factory(files)
This allows me to pass additional arguments to it, e.g. the files to serve.
Also refactored my class-based views to accept jinja as an argument, e.g:
app.add_route(
TableView.as_view(jinja),
'/<db_name:[^/]+>/<table:[^/]+?><as_json:(.jsono?)?$>'
)
|
||
|---|---|---|
| .. | ||
| templates | ||
| __init__.py | ||
| app.py | ||
| cli.py | ||