--get now calls startup() plugin hooks, closes #934

This commit is contained in:
Simon Willison 2020-08-15 13:38:15 -07:00
commit 45414f8412
4 changed files with 59 additions and 21 deletions

View file

@ -416,12 +416,6 @@ def serve(
ds = Datasette(files, **kwargs)
if get:
client = TestClient(ds.app())
response = client.get(get)
click.echo(response.text)
return
if return_instance:
# Private utility mechanism for writing unit tests
return ds
@ -432,6 +426,12 @@ def serve(
# Run async sanity checks - but only if we're not under pytest
asyncio.get_event_loop().run_until_complete(check_databases(ds))
if get:
client = TestClient(ds.app())
response = client.get(get)
click.echo(response.text)
return
# Start the server
if root:
print("http://{}:{}/-/auth-token?token={}".format(host, port, ds._root_token))