Replit
Replit can run DaloyJS as a Node web server. Use the Node adapter, publish as a web server, and make sure the process listens on 0.0.0.0 and the platform-provided PORT. For APIs with variable traffic, start with Autoscale. For always-on workloads or long-running background work, use Reserved VM.
- 01replitImport or createGitHub import, template, or Agent project
- 02Installpnpm install, Node 24+
- 03Buildpnpm build
- 04PublishAutoscale or Reserved VM web server
- 05MonitorPublishing logs, health, resources
When to choose Replit
- You want browser-based development plus deployment in one place.
- You want Replit Agent to help inspect, modify, and publish the app.
- You are deploying a small to medium Node API and want Autoscale or Reserved VM without writing Docker config.
1. Check Node and pnpm
DaloyJS requires Node.js 24 or newer and pnpm 11 or newer. In Replit Shell, verify the runtime before publishing:
Keep the requirement visible in package.json so Replit Agent and the publishing environment do not silently drift to an older runtime:
2. Server entrypoint
Bind to all interfaces and use the PORT value provided by Replit. This matters for published apps, not just local preview.
3. Scripts
Keep development and production commands separate. Use the production command in the Publishing pane.
4. Replit app configuration
The .replit file controls the editor Run button. Publishing can also ask for build and run commands in the Publishing pane. Keep them aligned so Preview and the published app behave the same way.
5. Publish
- Run the app in the Project Editor and open Preview. Fix Preview before publishing.
- Open Publishing and choose Autoscale for an API that should scale down when idle, or Reserved VM when you need an always-on machine.
- Set the build command to
pnpm install --frozen-lockfile && pnpm build. - Set the run command to
pnpm start. - Choose Web server, not Background worker.
- Add production Secrets for every required environment variable.
Secrets
Replit Secrets are exposed to the app as environment variables. Add runtime values such as NODE_ENV, database URLs, auth secrets, JWT keys, and webhook secrets through Replit Secrets or published app secrets. Do not commit a .env file.
Trust Replit's proxy
Published Replit web apps sit behind Replit's edge proxy. If your DaloyJS app enables production forwarded-header protection, declare the proxy posture instead of disabling the guard:
If you put Cloudflare or another proxy in front of Replit, count both hops and use TRUST_PROXY_HOPS=2. See the deployment overview for the proxy posture matrix.
Replit Agent guidance
Replit Agent reads replit.md when it exists in the project root. Add a short file that tells Agent this is a DaloyJS API and that it must keep pnpm, Node 24, security defaults, and the production commands intact:
Gotchas
- Do not bind to
localhostor127.0.0.1in a published web server. Use0.0.0.0. - Do not hard-code
PORT=80. Let Replit providePORTunless you have explicitly configured port mappings. - Published app secrets are part of publishing setup. Check them when Preview works but the published URL fails.
- The app must keep running. A one-shot script belongs in Scheduled Deployments, not a web-server deployment.
- Replit performs a health check before marking the published app live. Keep startup fast and serve a cheap
/healthzendpoint.