mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Test confirming plugins can over-ride default routes, closes #1517
This commit is contained in:
parent
0156c6b5e5
commit
6e971b4ac1
2 changed files with 28 additions and 1 deletions
|
|
@ -176,4 +176,12 @@ def register_routes(datasette):
|
|||
if not config:
|
||||
return
|
||||
path = config["path"]
|
||||
return [(r"/{}/$".format(path), lambda: Response.text(path.upper()))]
|
||||
|
||||
def new_table(request):
|
||||
return Response.text("/db/table: {}".format(sorted(request.url_vars.items())))
|
||||
|
||||
return [
|
||||
(r"/{}/$".format(path), lambda: Response.text(path.upper())),
|
||||
# Also serves to demonstrate over-ride of default paths:
|
||||
(r"/(?P<db_name>[^/]+)/(?P<table_and_format>[^/]+?$)", new_table),
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue