Express
1. Code
The application listens on the port from the PORT variable and trusts the panel's proxy:
import express from "express";
const app = express();
app.set("trust proxy", true); // req.protocol = https, req.ip = the visitor's address
app.get("/", (req, res) => res.send("Hello from Express"));
app.get("/health", (req, res) => res.json({ ok: true }));
app.listen(process.env.PORT || 3000);
In package.json — "type": "module" and express in dependencies.
2. Project
- Create a project with the Node.js handler (version stable).
- Start command:
cd src && node server.js. - Build command:
cd src && npm ci— installs the dependencies withoutdevDependencies, since there is nothing to build.
The "Handler" block: start with node server.js, the build only installs the dependencies. - Connect the repository in the Git deploy block with the
srcdirectory (how) and click "Deploy".
3. What else
- Settings — in the "Environment variables" block (
process.env.DATABASE_URLand so on). - Health check — a route like
/healthis convenient to poll with an external monitoring service. - Workers for queues and bots — as separate background processes in the "Processes and cron" block.

process.env.DATABASE_URL comes from here; the value is an example.4. If something goes wrong
- 502. The server is not listening on
PORTor is bound to127.0.0.1— callapp.listen(process.env.PORT)without an address. - Links are built with
http://, andreq.ipis the proxy's address.app.set("trust proxy", true)is missing.