This commit is contained in:
Tracker-Friendly 2024-02-26 18:59:58 +00:00
parent 5b10545d70
commit c72142cd6f
1 changed files with 9 additions and 0 deletions

9
main
View File

@ -96,6 +96,15 @@ def check_username_taken(username):
return "error" return "error"
return post["id"] return post["id"]
# Enable CORS for all origins
@app.after_request
async def add_cors_headers(response):
response.headers.add("Access-Control-Allow-Origin", "*")
response.headers.add("Access-Control-Allow-Headers", "*")
response.headers.add("Access-Control-Allow-Methods", "*")
return response
# Main page # Main page
@app.route("/") @app.route("/")
async def main(): async def main():