Futon
A Futon app runs as a Cloudflare Worker: your code is bundled into one module and handles every request to the environment.
Detection
A project is Futon when @rasenganjs/futon is in its dependencies. A project that depends on both @rasenganjs/futon and hono fails detection; deploy each app as its own project.
Your entry file
The entry must default-export a fetch handler. toWinterCgHandler turns a Futon app into one and passes your environment variables through:
A Node.js server doesn't run on Workers: an entry that starts one (NodeDevAdapter, listen()) fails the build with a message saying so. Keep it in a separate file for local development.
How the entry is found
The same as for Hono: Hiraiship runs your build command, then bundles the first entry that exists among index.js in the output directory, the main of a wrangler config file, then src/index.ts, src/index.js, index.ts and index.js. Everything it imports is bundled into one ES module. See Hono.
Defaults
| Setting | Default |
|---|---|
| Install command | From your lockfile, see Frameworks |
| Build command | npm run build --if-present: your build script, or nothing |
| Output directory | dist, where the entry is looked for first |
Environment variables
Variables are on ctx.runtime.env. Pass a type to Futon to have them typed:
What's available
The same runtime as Hono: Node.js built-ins through Cloudflare's compatibility layer, outgoing fetch calls up to your plan's limits, no file system.