flask socket Io deploy fails

Im trying to deploy a flask socket IO server, I started with the flask template from railway but when I deploy I get these errors. It works fine locally. Anyone know what might be the issue or how to fix it?
No description
5 Replies
Percy
Percy11mo ago
Project ID: 8a2a5193-1ab5-4672-b54e-52bd5b2545b9
YoussefZayed
YoussefZayed11mo ago
8a2a5193-1ab5-4672-b54e-52bd5b2545b9
Brody
Brody11mo ago
theres unfortunately not much information to go off of in your logs, please add more verbose error logging to your code
YoussefZayed
YoussefZayed11mo ago
@Brody The code is pretty simple its just 1 file with a few socket Io handlers main.py
import random
from flask import Flask, request
from flask_socketio import SocketIO, emit
import datetime
from flask_cors import CORS
import requests

app = Flask(__name__)
socketio = SocketIO(app, cors_allowed_origins='*')

@app.route('/')
def index():
return 'Welcome to your Flask-SocketIO server!'

@socketio.on('connect')
def handle_connect():
// code here

// other handlers

@socketio.on('disconnect')
def handle_disconnect():
// code



if __name__ == '__main__':
socketio.run(app, debug=True, port=os.getenv("PORT", default=5000))
import random
from flask import Flask, request
from flask_socketio import SocketIO, emit
import datetime
from flask_cors import CORS
import requests

app = Flask(__name__)
socketio = SocketIO(app, cors_allowed_origins='*')

@app.route('/')
def index():
return 'Welcome to your Flask-SocketIO server!'

@socketio.on('connect')
def handle_connect():
// code here

// other handlers

@socketio.on('disconnect')
def handle_disconnect():
// code



if __name__ == '__main__':
socketio.run(app, debug=True, port=os.getenv("PORT", default=5000))
this is the entire project
Brody
Brody11mo ago
not much information to go off of, sorry maybe look for some examples online on running socketio and flask together with gunicorn
Want results from more Discord servers?
Add your server