Skip to content

Commit d3f80ce

Browse files
Add SSL support to API server with certificate and key paths
1 parent d9f1491 commit d3f80ce

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

api/main.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from flask import Flask
22
from flask_cors import CORS
3+
import os
34

45
app = Flask(__name__)
56
CORS(app)
@@ -9,4 +10,7 @@ def home():
910
return "Welcome to the API server!"
1011

1112
if __name__ == '__main__':
12-
app.run(debug=True, port=3000)
13+
cert_path = '/root/docker/cas/cert.pem'
14+
key_path = '/root/docker/cas/key.pem'
15+
16+
app.run(debug=True, port=3000, ssl_context=(cert_path, key_path))

0 commit comments

Comments
 (0)