Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi, I cannot seem to set up a very simple socket.io/express server on App Platform. Works fine locally, but once I deploy it as a web-server on App Platform, the express server seems to run, but not the socket connection.
Here is the simple index.js file:
const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
const { Server } = require('socket.io');
const io = new Server(server);
app.get('/', (req, res) => {
res.sendFile('index.html', { root: __dirname });
});
io.on('connection', (socket) => {
console.log('a user connected');
});
const PORT = process.env.PORT || 3000;
server.listen(PORT, () => {
console.log('listening on *:', PORT);
});
When I try to ping it:
curl "<the server URL>/socket.io/?EIO=4&transport=polling"
I get no response.
Any ideas?
a6309a057c3f4cb38fb2e7feb67236
KFSys
ef1ed44cc2154be3bcbb2d727878f8
Devs Neonetworks
1e6b823ea20d4cb189a34a922f5588
Telmo Valverde
erik-jan martens
Henry Mui
anthonycarreon
garantieheld
Marin