Mounting apps
Hamur mounts other apps inside itself, and runs inside other apps. This page says which preset can do which; the guide for each piece is in Server.
Other apps inside Hamur
| You have | Use | Runs on | Guide |
|---|---|---|---|
a Hono app, a Workers module, any { fetch(request, env, ctx) } | fromWebHandler(app, { base? }) in a raw handler with method: "*" | every preset that has a server | Mount a fetch app |
an Express or Connect app, any (req, res, next) middleware | fromNodeHandler(handler) in a raw handler with method: "*" | presets whose serverTarget is bun or node | Run an Express or Connect handler |
| a site you are moving over one page at a time | server.fallbackProxy: "https://old.example.com" | every preset that has a server | Fall back to another server |
fromNodeHandler needs node:http. On the presets that build for the browser target (cloudflare, cloudflare-pages, netlify-edge, standard, lambda-edge, zephyr and vercel with vercel.runtime: "edge") the build fails and names the route: fromNodeHandler in server/legacy.ts#legacy needs a node or bun preset; the "cloudflare" preset has no node:http.
server.fallbackProxy forwards a request that matches no public file, no handler route and no page, as a proxy route rule forwards, so it follows the same rules for headers, redirects and an unreachable origin (502). The static family has no server to forward from and lists server.fallbackProxy among the features it drops. With node-middleware and middleware({ fallthrough: true }), the proxy is tried before next(). In the browser, a Link to a path that no concrete page matches is a full page load, since that page may live on the old server.
The signatures are in the API reference: fromWebHandler and fromNodeHandler. The sample files are Mount a fetch app and the fallback proxy config.
Hamur inside other apps
| You run | Use | Page |
|---|---|---|
| a Node server of your own (Express, Fastify, Hono on Node, h3) | --preset node-middleware: import middleware or handler from the entry | Node middleware |
a host that calls a fetch export (a Worker runtime, Deno, a Bun script) | --preset standard: export default { fetch(request, ctx?) } | Standard |
| a Bun or Node script that starts and stops the server itself | fetch and listen of the bun and node entry | Server entry exports |
| another Worker that calls this one | a service binding with createFetch({ binding }) | Service bindings |