Skip to content

Standard

--preset standard builds a fetch export and nothing else. It is chosen by name only; no environment variable selects it.

Reference

Presetstandard
Runs onany host that calls a fetch export
event.runtime.namestandard
Server targetbrowser
Lifetime, startupprocess, request

Output

text
.output/
  hamur.json
  server/index.mjs           export default { fetch(request, ctx?) }
  public/                    for the host that serves files

Config keys

This preset has no key of its own.

Detection

None. Name it with --preset, preset in the config or HAMUR_PRESET; no environment variable selects it.

Deploy command

No hamur deploy command: it exits 1 for this preset. Import .output/server/index.mjs in the host's runtime and call its fetch. hamur preview runs the built output with Hamur's own runner.

Limits

  • Runs: streamed answers.
  • Experimental: private app/env.ts entries read at run time.
  • Does not run: WebSockets and server.syncedState, server.pubsub, server.metrics, image transforms at run time, Durable Object classes.
  • scheduledTasks, tasks.queue and tasks.runOnStart do not apply; the request body limit is the host's. fs, sqlite and redis storage and WebSockets fail the build.

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).

text
.output/server/index.mjs   export default { fetch(request, ctx?) }
.output/public/            for the host that serves files

The entry opens no listener and serves no public file; the host that imports it does both. When ctx has a waitUntil, work the app hands to waitUntil goes there. The bundle is built for the browser target and imports no node: module, so any runtime with Web Request and Response can call it. useRuntimeEnv() reads globalThis.process?.env ?? {}: with no process on the host it is an empty object, so pass settings the app needs through the host's own means.

The fs, sqlite and redis storage drivers, WebSockets, scheduledTasks and tasks.runOnStart need a long-lived process or a socket API and fail the build on standard; tasks.queue is ignored with a warning.

hamur preview imports the entry and runs it under Bun.serve, with .output/public/ served beside it.