summaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
Diffstat (limited to 'src/services')
-rwxr-xr-xsrc/services/vyos-http-api-server7
1 files changed, 6 insertions, 1 deletions
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}")