Fix cors whitelist
This commit is contained in:
6
app.py
6
app.py
@@ -13,7 +13,7 @@ from flask_socketio import SocketIO
|
||||
app = Flask(__name__)
|
||||
jinja_partials.register_extensions(app)
|
||||
htmx = HTMX(app)
|
||||
socketio = SocketIO(app)
|
||||
socketio = SocketIO(app, cors_allowed_origins='*')
|
||||
|
||||
|
||||
@app.after_request
|
||||
@@ -31,7 +31,7 @@ def response_minify(response):
|
||||
return response
|
||||
|
||||
|
||||
@socketio.on('event')
|
||||
@socketio.on('message')
|
||||
def handle_message(data):
|
||||
print('received message: ' + data)
|
||||
|
||||
@@ -56,4 +56,4 @@ def save_request(request):
|
||||
if __name__ == '__main__':
|
||||
# Bind to PORT if defined, otherwise default to 5000.
|
||||
port = int(os.environ.get('PORT', 5000))
|
||||
socketio.run(app, host='127.0.0.1', port=port, cors_allowed_origins='*')
|
||||
socketio.run(app, host='127.0.0.1', port=port)
|
||||
|
||||
Reference in New Issue
Block a user