Fix the CORS issue that arose again?
This commit is contained in:
parent
72c6735cba
commit
ab41114b16
1 changed files with 4 additions and 0 deletions
|
|
@ -6,11 +6,15 @@ import os
|
|||
import threading
|
||||
from flask import Flask, request, jsonify
|
||||
from flask_socketio import SocketIO, emit, join_room, leave_room
|
||||
from flask_cors import CORS
|
||||
|
||||
# Flask app for REST API and WebSocket
|
||||
app = Flask(__name__)
|
||||
socketio = SocketIO(app, cors_allowed_origins="*") # Allow all origins
|
||||
|
||||
# Enable CORS for the Flask app
|
||||
CORS(app)
|
||||
|
||||
CHATPORT = 8181
|
||||
BUFFER_SIZE = 1024
|
||||
MAX_CONNECT_QUEUE = 10
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue