Reload the server on a file change (#817)

* Added simple server reload support

* updated help text
This commit is contained in:
Jeffrey Gelens 2017-02-09 03:22:14 +01:00 committed by Steve Pulec
parent 1a01bae74e
commit 8fc1ad03bd

View File

@ -137,6 +137,12 @@ def main(argv=sys.argv[1:]):
'-p', '--port', type=int,
help='Port number to use for connection',
default=5000)
parser.add_argument(
'-r', '--reload',
action='store_true',
help='Reload server on a file change',
default=False
)
args = parser.parse_args(argv)
@ -144,7 +150,8 @@ def main(argv=sys.argv[1:]):
main_app = DomainDispatcherApplication(create_backend_app, service=args.service)
main_app.debug = True
run_simple(args.host, args.port, main_app, threaded=True)
run_simple(args.host, args.port, main_app, threaded=True, use_reloader=args.reload)
if __name__ == '__main__':
main()