feat: Add cors
All checks were successful
Build Docker / BuildImage (push) Successful in 35s

This commit is contained in:
2025-08-22 20:59:48 +10:00
parent 34348fbf33
commit 499b19562d

View File

@@ -458,5 +458,14 @@ def not_found(e):
# endregion
@app.after_request
def add_cors_headers(response):
# Allow CORS for all API endpoints
if request.path.startswith('/api/'):
response.headers['Access-Control-Allow-Origin'] = '*'
response.headers['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS'
response.headers['Access-Control-Allow-Headers'] = 'Content-Type, Authorization'
return response
if __name__ == "__main__":
app.run(debug=True, port=5000, host="127.0.0.1")