From 7b31dd720d96bc481323e3b00100da718f551cd5 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 6 May 2020 17:49:12 -0500 Subject: http api: T2395: add waitress as production WSGI server --- src/services/vyos-http-api-server | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/services') diff --git a/src/services/vyos-http-api-server b/src/services/vyos-http-api-server index 4a653bb66..4c41fa96d 100755 --- a/src/services/vyos-http-api-server +++ b/src/services/vyos-http-api-server @@ -27,6 +27,7 @@ import signal import vyos.config from flask import Flask, request +from waitress import serve from functools import wraps @@ -395,4 +396,8 @@ if __name__ == '__main__': signal.signal(signal.SIGTERM, sig_handler) - app.run(host=server_config["listen_address"], port=server_config["port"], debug=True) + try: + serve(app, host=server_config["listen_address"], + port=server_config["port"]) + except OSError as e: + print(f"OSError {e}") -- cgit v1.2.3