# 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](/deploy/presets/node).

## Reference

|                      |                                 |
| -------------------- | ------------------------------- |
| Preset               | `heroku`                        |
| Host alias of        | `node`                          |
| Runs on              | Heroku (a host alias of `node`) |
| `event.runtime.name` | `node`                          |
| Server target        | `node`                          |
| Lifetime, startup    | `process`, `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

| Key                         | Default               | What it does                                                                                               |
| --------------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------- |
| `server.https`              | unset                 | `{ key, cert, ca?, passphrase? }` makes the server serve TLS; env `HAMUR_SSL_KEY` and `HAMUR_SSL_CERT` win |
| `server.unix`               | unset                 | listen on this Unix socket instead of `PORT` and `HOST`; env `HAMUR_UNIX_SOCKET` wins                      |
| `server.maxRequestBodySize` | `134217728` (128 MiB) | the largest request body the server accepts                                                                |
| `build.compressPublic`      | `false`               | write `.br`, `.zst` and `.gz` copies of text, JSON, SVG, font and WASM files of 1 KiB or more              |
| `node.requestTimeout`       | `300000`              | milliseconds a request may take to arrive; `0` is no timeout                                               |
| `node.headersTimeout`       | `66000`               | milliseconds for the request headers, never above `requestTimeout`                                         |
| `node.maxConnections`       | no cap                | a positive integer                                                                                         |
| `node.cluster`              | unset                 | workers 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#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](/deploy#preset-features)).
