summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/control1
-rwxr-xr-xsrc/services/vyos-http-api-server7
2 files changed, 7 insertions, 1 deletions
diff --git a/debian/control b/debian/control
index 592d5153d..32c0286a4 100644
--- a/debian/control
+++ b/debian/control
@@ -29,6 +29,7 @@ Depends: python3,
python3-hurry.filesize,
python3-vici (>= 5.7.2),
python3-flask,
+ python3-waitress,
python3-netaddr,
python3-zmq,
cron,
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}")