kopia lustrzana https://github.com/simonw/datasette
Added --reload argument to 'immutabase serve' command
Uses hupper to restart the server when the code changes. Useful for development. Depends on https://pypi.python.org/pypi/hupperpull/81/head
rodzic
8af7bc100c
commit
abb591d832
|
@ -21,8 +21,13 @@ def build(files):
|
||||||
@click.option('-h', '--host', default='0.0.0.0')
|
@click.option('-h', '--host', default='0.0.0.0')
|
||||||
@click.option('-p', '--port', default=8001)
|
@click.option('-p', '--port', default=8001)
|
||||||
@click.option('--debug', is_flag=True)
|
@click.option('--debug', is_flag=True)
|
||||||
def serve(files, host, port, debug):
|
@click.option('--reload', is_flag=True)
|
||||||
|
def serve(files, host, port, debug, reload):
|
||||||
"""Serve up specified database files with a web UI"""
|
"""Serve up specified database files with a web UI"""
|
||||||
|
if reload:
|
||||||
|
import hupper
|
||||||
|
hupper.start_reloader('immutabase.cli.serve')
|
||||||
|
|
||||||
click.echo('Serve! files={} on port {}'.format(files, port))
|
click.echo('Serve! files={} on port {}'.format(files, port))
|
||||||
app = app_factory(files)
|
app = app_factory(files)
|
||||||
app.run(host=host, port=port, debug=debug)
|
app.run(host=host, port=port, debug=debug)
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -11,6 +11,7 @@ setup(
|
||||||
'click-default-group==1.2',
|
'click-default-group==1.2',
|
||||||
'sanic==0.6.0',
|
'sanic==0.6.0',
|
||||||
'sanic-jinja2==0.5.5',
|
'sanic-jinja2==0.5.5',
|
||||||
|
'hupper==1.0',
|
||||||
],
|
],
|
||||||
entry_points='''
|
entry_points='''
|
||||||
[console_scripts]
|
[console_scripts]
|
||||||
|
|
Ładowanie…
Reference in New Issue