Framework Guides5 min read•Updated September 2026

Deploying Node.js & Express APIs

Host persistent Express.js, Fastify, and custom Node.js APIs in sandboxed, resource-isolated micro-containers.

Step-by-Step Overview

1
Define Start ScriptEnsure package.json has a valid "start" script pointing to your server file.
2
Bind to Process PortListen on process.env.PORT || 3000 to accept edge proxy connections.
3
Deploy ContainerLaunch your backend container with allocated memory and CPU limits.

Sandboxed Node.js Micro-Containers

AcadSites packages your Node.js backend into an isolated, lightweight container sandbox. Your application runs with guaranteed memory limits, preventing rogue processes from exceeding allocated boundaries.

package.json Configuration

Your repository must include a "start" script in package.json. The AcadSites container runtime executes this command to boot your API:

package.json
{
  "name": "my-express-api",
  "version": "1.0.0",
  "main": "server.js",
  "scripts": {
    "start": "node server.js",
    "build": "tsc"
  },
  "dependencies": {
    "express": "^4.21.0",
    "cors": "^2.8.5"
  }
}

Port Binding Best Practice

Always bind your HTTP server to the dynamically injected PORT environment variable with a local fallback:

server.js
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;

app.use(express.json());

app.get('/api/health', (req, res) => {
  res.json({ status: 'healthy', timestamp: new Date() });
});

app.listen(PORT, () => {
  console.log(`Server listening on port ${PORT}`);
});
Was this documentation page helpful?
Instant Edge Deployment

Ready to experience zero-overage cloud hosting?

Deploy your React, Next.js, or Node.js application in under 60 seconds with automated SSL.

Zero Overage LiabilityAutomated Edge SSLFree .acadkits.dev Subdomain