kopia lustrzana https://github.com/simonw/datasette
--reload now also reloads if databases change on disk
rodzic
48d24c6589
commit
eac08f0dfc
|
|
@ -262,7 +262,7 @@ def package(
|
||||||
@click.option(
|
@click.option(
|
||||||
"--reload",
|
"--reload",
|
||||||
is_flag=True,
|
is_flag=True,
|
||||||
help="Automatically reload if code change detected - useful for development",
|
help="Automatically reload if database or code change detected - useful for development",
|
||||||
)
|
)
|
||||||
@click.option(
|
@click.option(
|
||||||
"--cors", is_flag=True, help="Enable CORS by serving Access-Control-Allow-Origin: *"
|
"--cors", is_flag=True, help="Enable CORS by serving Access-Control-Allow-Origin: *"
|
||||||
|
|
@ -345,6 +345,7 @@ def serve(
|
||||||
import hupper
|
import hupper
|
||||||
|
|
||||||
reloader = hupper.start_reloader("datasette.cli.serve")
|
reloader = hupper.start_reloader("datasette.cli.serve")
|
||||||
|
reloader.watch_files(files)
|
||||||
if metadata:
|
if metadata:
|
||||||
reloader.watch_files([metadata.name])
|
reloader.watch_files([metadata.name])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ Options:
|
||||||
-h, --host TEXT host for server, defaults to 127.0.0.1
|
-h, --host TEXT host for server, defaults to 127.0.0.1
|
||||||
-p, --port INTEGER port for server, defaults to 8001
|
-p, --port INTEGER port for server, defaults to 8001
|
||||||
--debug Enable debug mode - useful for development
|
--debug Enable debug mode - useful for development
|
||||||
--reload Automatically reload if code change detected - useful for
|
--reload Automatically reload if database or code change detected -
|
||||||
development
|
useful for development
|
||||||
--cors Enable CORS by serving Access-Control-Allow-Origin: *
|
--cors Enable CORS by serving Access-Control-Allow-Origin: *
|
||||||
--load-extension PATH Path to a SQLite extension to load
|
--load-extension PATH Path to a SQLite extension to load
|
||||||
--inspect-file TEXT Path to JSON file created using "datasette inspect"
|
--inspect-file TEXT Path to JSON file created using "datasette inspect"
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue