Search docs

Jump between documentation pages.

Heroku

Heroku still runs DaloyJS happily as a Node web dyno. Use the Node adapter, declare a Procfile, and pin to a supported stack.

When to choose Heroku

  • You already have Heroku add-ons and pipelines and don't want to migrate.
  • You want a known, stable deploy story without a YAML file.

Server entrypoint

ts
// src/server.ts
import { serve } from "@daloyjs/core/node";
import { app } from "./app.js";

serve(app, {
  port: Number(process.env.PORT ?? 3000),
  hostname: "0.0.0.0",
});

Procfile

text
web: node dist/server.js

Stack

Use heroku-24 or heroku-26. heroku-22 is deprecated.

bash
heroku stack:set heroku-24 --app my-daloy-api

Buildpack

The heroku/nodejs buildpack is auto-detected from package.json.

bash
heroku buildpacks:set heroku/nodejs --app my-daloy-api

Deploy

bash
heroku create my-daloy-api --stack heroku-24
heroku config:set SESSION_SECRET=...
git push heroku main

Gotchas

  • Heroku sends SIGTERM and then SIGKILLafter 30 seconds. Set the Node adapter's shutdownTimeoutMs to something well under 30,000.
  • Bind to 0.0.0.0 on the PORTenv var or the routing layer won't reach the process.

See also