Closed wizigon closed 2 years ago
I followed alternative-express-compatibility-layer to employ uWebSockets.js in my Colyseus server. I tried to enable the monitoring module by the following code snippet but it failed:
const uwsTransport = new uWebSocketsTransport({}); const app = expressify(uwsTransport.app); app.use(cors()); app.use(express.json()); const auth = basicAuth.default({ users: { user: "password", }, challenge: true, }); app.use(auth); app.use("/colyseus", monitor()); const gameServer = new Server({ transport: new uWebSocketsTransport({}), });
Querying to some-domain/colyseus/api just returned me with blank content.
some-domain/colyseus/api
What am I doing wrong with this code snippet?
Hi @wizigon, you're instantianting uWebSocketsTransport twice.
uWebSocketsTransport
You should use the same instance created in the first place:
const gameServer = new Server({ transport: uwsTransport });
I followed alternative-express-compatibility-layer to employ uWebSockets.js in my Colyseus server. I tried to enable the monitoring module by the following code snippet but it failed:
Querying to
some-domain/colyseus/api
just returned me with blank content.What am I doing wrong with this code snippet?