Question on App Platform?

Hi, I cannot seem to set up a very simple 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('');
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>/"

I get no response.

Any ideas?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer