mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
register_routes() plugin hook datasette argument, closes #1404
This commit is contained in:
parent
6f1731f305
commit
eccfeb0871
6 changed files with 37 additions and 4 deletions
|
|
@ -960,7 +960,7 @@ class Datasette:
|
|||
"""Returns an ASGI app function that serves the whole of Datasette"""
|
||||
routes = []
|
||||
|
||||
for routes_to_add in pm.hook.register_routes():
|
||||
for routes_to_add in pm.hook.register_routes(datasette=self):
|
||||
for regex, view_fn in routes_to_add:
|
||||
routes.append((regex, wrap_view(view_fn, self)))
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ def register_facet_classes():
|
|||
|
||||
|
||||
@hookspec
|
||||
def register_routes():
|
||||
def register_routes(datasette):
|
||||
"""Register URL routes: return a list of (regex, view_function) pairs"""
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue