Skip to content

Heroku

heroku is a host alias of node: the build is the node build, byte for byte, and the log says Building for node, host heroku. hamur.json records { "preset": "node", "alias": "heroku" }. The build log adds the line to put in the Procfile: web: node .output/server/index.mjs. The text of the node preset applies; see Node.

Reference

Presetheroku
Host alias ofnode
Runs onHeroku (a host alias of node)
event.runtime.namenode
Server targetnode
Lifetime, startupprocess, load

Output

text
.output/
  hamur.json
  public/                    client assets and public/ files, with .gz, .br and .zst copies when build.compressPublic is on
  server/
    index.mjs                the server entry
    public-assets.json       size and strong ETag of every public file
    node_modules/            traced externals, with package.json (only when the build traced any)

Config keys

KeyDefaultWhat it does
server.httpsunset{ key, cert, ca?, passphrase? } makes the server serve TLS; env HAMUR_SSL_KEY and HAMUR_SSL_CERT win
server.unixunsetlisten on this Unix socket instead of PORT and HOST; env HAMUR_UNIX_SOCKET wins
server.maxRequestBodySize134217728 (128 MiB)the largest request body the server accepts
build.compressPublicfalsewrite .br, .zst and .gz copies of text, JSON, SVG, font and WASM files of 1 KiB or more
node.requestTimeout300000milliseconds a request may take to arrive; 0 is no timeout
node.headersTimeout66000milliseconds for the request headers, never above requestTimeout
node.maxConnectionsno capa positive integer
node.clusterunsetworkers forked with node:cluster, a positive integer or "auto"; env HAMUR_CLUSTER_WORKERS wins

Detection

The build selects it when DYNO is set, unless --preset, preset or HAMUR_PRESET names another. It is a row of the one table of markers in Choosing a preset.

Deploy command

No hamur deploy command: it exits 1 for this preset. Run node .output/server/index.mjs through the Procfile. The preview command of the preset, which hamur preview runs or prints, is node .output/server/index.mjs.

Limits

  • Runs: WebSockets and server.syncedState, streamed answers, server.metrics, private app/env.ts entries read at run time.
  • Does not run: server.pubsub, image transforms at run time, Durable Object classes.
  • scheduledTasks run in process in UTC; tasks.queue does not apply. The request body limit is server.maxRequestBodySize, 128 MiB.

The levels are the features of the preset: hamur build warns or fails when the app uses a feature the preset does not run (see Preset features).