mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Added /-/actor.json - refs #699
Also added JSON highlighting to introspection documentation.
This commit is contained in:
parent
9315bacf6f
commit
1fc6ceefb9
4 changed files with 57 additions and 9 deletions
|
|
@ -586,6 +586,9 @@ class Datasette:
|
|||
)
|
||||
return d
|
||||
|
||||
def _actor(self, request):
|
||||
return {"actor": request.scope.get("actor", None)}
|
||||
|
||||
def table_metadata(self, database, table):
|
||||
"Fetch table-specific metadata."
|
||||
return (
|
||||
|
|
@ -762,6 +765,10 @@ class Datasette:
|
|||
JsonDataView.as_asgi(self, "databases.json", self._connected_databases),
|
||||
r"/-/databases(?P<as_format>(\.json)?)$",
|
||||
)
|
||||
add_route(
|
||||
JsonDataView.as_asgi(self, "actor.json", self._actor, needs_request=True),
|
||||
r"/-/actor(?P<as_format>(\.json)?)$",
|
||||
)
|
||||
add_route(
|
||||
PatternPortfolioView.as_asgi(self), r"/-/patterns$",
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue