Fly.Website reference
AssetDeployment
Section titled “AssetDeployment”Source:
src/Fly/Website/AssetDeployment.ts
Upload a local directory into a public Tigris bucket for Fly Website statics. HTML is never cached; everything else is immutable.
Source:
src/Fly/Website/Astro.ts
Deploy an Astro application to Fly: a Service running the Node adapter’s serve entry (static files first, then the framework handler) on port 3000.
Pages render on demand by default (output: "server"). With
astro: { output: "static" } every page is prerendered and the deploy
is assets-only.
Astro: Creating Astro Sites
Section titled “Astro: Creating Astro Sites”Basic Astro App
const site = yield* Fly.Website.Astro("Web", { rootDir: "./app",});Custom Domain
const site = yield* Fly.Website.Astro("Web", { rootDir: "./app", domain: "app.example.com",});Astro: Static Sites
Section titled “Astro: Static Sites”const site = yield* Fly.Website.Astro("Docs", { rootDir: "./docs", astro: { output: "static" }, assets: { notFoundHandling: "404-page" },});Foldkit
Section titled “Foldkit”Source:
src/Fly/Website/Foldkit.ts
Deploy a Foldkit app to Fly. Foldkit apps are
client-only Vite projects, so this is Vite with SPA fallback
to index.html so deep links boot the app.
Foldkit: Creating Foldkit Sites
Section titled “Foldkit: Creating Foldkit Sites”Foldkit app
const site = yield* Fly.Website.Foldkit("Web");Project in a subdirectory
const site = yield* Fly.Website.Foldkit("Web", { rootDir: "applications/web",});Foldkit: Single-Page Application Routing
Section titled “Foldkit: Single-Page Application Routing”const site = yield* Fly.Website.Foldkit("Web", { assets: { notFoundHandling: "404-page" },});Nextjs
Section titled “Nextjs”Source:
src/Fly/Website/Nextjs.ts
Deploy a Next.js application to Fly as a long-running Node process:
next build, then a serve entry that import("next") +
next({ dev: false }).prepare() + getRequestHandler(). The .next
output (and public/ when present) is baked into the image; next is
installed unbundled.
Do not use OpenNext AWS/CF wrappers — those are Lambda/workerd.
During alchemy dev the site is next dev and no cloud resources are
declared; Alchemy.remote() opts back into the live Service path.
Nextjs: Creating Next.js Sites
Section titled “Nextjs: Creating Next.js Sites”Basic Next.js App
const site = yield* Fly.Website.Nextjs("Web", { rootDir: "./app",});Custom Domain
const site = yield* Fly.Website.Nextjs("Web", { rootDir: "./app", domain: "app.example.com",});Source:
src/Fly/Website/Nuxt.ts
Deploy a Nuxt application to Fly: the nitro Node server on a Machine, static assets (prerendered pages included) baked into the image.
Nuxt: Creating Nuxt Sites
Section titled “Nuxt: Creating Nuxt Sites”Basic Nuxt App
const site = yield* Fly.Website.Nuxt("Web", { rootDir: "./app",});Custom Domain
const site = yield* Fly.Website.Nuxt("Web", { rootDir: "./app", domain: "app.example.com",});Octane
Section titled “Octane”Source:
src/Fly/Website/Octane.ts
Deploy an OctaneJS application to Fly: Octane’s SSR server on a Machine, static assets baked into the image.
Fly.Website.Octane selects hosting and automatically wraps Octane’s
default native Node output. Keep compiler and route settings in
octane.config.ts without an adapter. The legacy Node marker adapter
remains optional for existing projects.
Octane: Creating Octane Sites
Section titled “Octane: Creating Octane Sites”Basic Octane App
const site = yield* Fly.Website.Octane("Web", { rootDir: "./app",});Custom Domain
const site = yield* Fly.Website.Octane("Web", { rootDir: "./app", domain: "app.example.com",});ReactRouter
Section titled “ReactRouter”Source:
src/Fly/Website/ReactRouter.ts
Deploy a React Router v7 app (framework mode) to Fly: the SSR server on a Machine, static assets baked into the image, served assets-first then the framework handler.
The build runs through
@alchemy.run/frontend-frameworks/react-router with the
@alchemy.run/frontend-frameworks/react-router/node deploy target — both
must be installed in your project, alongside @react-router/dev,
react-router, and vite.
Your vite.config.ts needs no adapter wiring. React Router’s server
build is a ServerBuild manifest rather than a request handler, so the
integration wraps the manifest with createRequestHandler and packages
the resulting fetch handler as a Node HTTP server on port 3000.
React Server Components (React Router’s unstable RSC plugin) and
multi-environment builds are not supported yet — the build fails with an
actionable error when more than one server entry is emitted.
ReactRouter: Creating React Router Sites
Section titled “ReactRouter: Creating React Router Sites”Basic React Router App
const site = yield* Fly.Website.ReactRouter("Web", { rootDir: "./app",});Custom Domain
const site = yield* Fly.Website.ReactRouter("Web", { rootDir: "./app", domain: "app.example.com",});ReactRouter: Server Configuration
Section titled “ReactRouter: Server Configuration”Process Environment
const site = yield* Fly.Website.ReactRouter("Web", { rootDir: "./app", env: { GREETING: "Hello from React Router on Fly!", },});Read An Environment Variable From A Loader
export function loader() { return { greeting: process.env.GREETING ?? "Hello!" };}SolidStart
Section titled “SolidStart”Source:
src/Fly/Website/SolidStart.ts
Deploy a SolidStart application to Fly: the SSR server on a Machine, static assets (prerendered pages included) baked into the image, served assets-first then the framework handler.
The build runs through @alchemy.run/frontend-frameworks/solidstart with
the @alchemy.run/frontend-frameworks/solidstart/node deploy target —
both must be installed in your project, alongside @solidjs/start and
@solidjs/vite-plugin-nitro-2.
Your vite.config.ts needs no adapter wiring: the integration drives the
project’s own vite build and appends its own nitro plugin instance
carrying nitro’s node preset.
SolidStart: Creating SolidStart Sites
Section titled “SolidStart: Creating SolidStart Sites”Basic SolidStart App
const site = yield* Fly.Website.SolidStart("Web", { rootDir: "./app",});Custom Domain
const site = yield* Fly.Website.SolidStart("Web", { rootDir: "./app", domain: "app.example.com",});SolidStart: Server Configuration
Section titled “SolidStart: Server Configuration”const site = yield* Fly.Website.SolidStart("Web", { rootDir: "./app", env: { GREETING: "Hello from SolidStart on Fly!", },});SolidStart: Prerendering
Section titled “SolidStart: Prerendering”The integration owns the nitro plugin instance (a nitroV2Plugin() in
your vite.config.* is rejected), so nitro options — prerendering
included — go on the nitro prop. Prerendered pages are baked into the
image and served as static files.
const site = yield* Fly.Website.SolidStart("Web", { rootDir: "./app", nitro: { prerender: { routes: ["/", "/about"] } },});StaticSite
Section titled “StaticSite”Source:
src/Fly/Website/StaticSite.ts
Deploy a static site built by a shell command to Fly.
StaticSite runs a build command (e.g. npm run build / hugo),
content-hashes the output directory, and deploys a Service that serves
those files (plus /health). Use this when the site has its own build
step — Hugo, Zola, Eleventy, or any custom pipeline.
For Vite-based projects, prefer Fly.Website.Vite.
Build / Dev use constant logical ids under Namespace.push(id).
The Service stays in the caller namespace (same as
Cloudflare.Website.StaticSite).
StaticSite: Basic Usage
Section titled “StaticSite: Basic Usage”Deploying a Hugo site
const site = yield* Fly.Website.StaticSite("Blog", { build: { command: "hugo --minify", output: "public" },});SPA-style routing
const site = yield* Fly.Website.StaticSite("App", { build: { command: "npm run build", output: "dist" }, assets: { notFoundHandling: "single-page-application" },});StaticSite: Building from a Subdirectory
Section titled “StaticSite: Building from a Subdirectory”const site = yield* Fly.Website.StaticSite("Web", { path: "apps/web", build: { command: "npm run build", output: "dist" },});StaticSite: Local Development
Section titled “StaticSite: Local Development”const site = yield* Fly.Website.StaticSite("App", { build: { command: "npm run build", output: "dist" }, dev: { command: "npm run dev" },});SvelteKit
Section titled “SvelteKit”Source:
src/Fly/Website/SvelteKit.ts
Deploy a SvelteKit application to Fly: kit’s SSR server on a Machine, static assets baked into the image, served assets-first then the framework handler.
SvelteKit: Creating SvelteKit Sites
Section titled “SvelteKit: Creating SvelteKit Sites”Basic SvelteKit App
const site = yield* Fly.Website.SvelteKit("Web", { rootDir: "./app",});Custom Domain
const site = yield* Fly.Website.SvelteKit("Web", { rootDir: "./app", domain: "app.example.com",});TanStackStart
Section titled “TanStackStart”Source:
src/Fly/Website/TanStackStart.ts
Deploy a TanStack Start application to Fly: the SSR server on a Machine, client assets baked into the image, served assets-first then the framework handler.
The build runs through
@alchemy.run/frontend-frameworks/tanstack-start with the
@alchemy.run/frontend-frameworks/tanstack-start/node deploy target —
both must be installed in your project, alongside
@tanstack/react-start (or @tanstack/solid-start) and vite.
Your vite.config.ts needs no adapter wiring: TanStack Start is pure
Vite, so the integration drives the project’s own vite build, forces
the SSR bundle to be self-contained, and wraps its fetch handler as a
Node HTTP server on port 3000.
TanStackStart: Creating TanStack Start Sites
Section titled “TanStackStart: Creating TanStack Start Sites”Basic TanStack Start App
const site = yield* Fly.Website.TanStackStart("Web", { rootDir: "./app",});Custom Domain
const site = yield* Fly.Website.TanStackStart("Web", { rootDir: "./app", domain: "app.example.com",});TanStackStart: Server Configuration
Section titled “TanStackStart: Server Configuration”Process Environment
const site = yield* Fly.Website.TanStackStart("Web", { rootDir: "./app", env: { GREETING: "Hello from TanStack Start on Fly!", },});Read An Environment Variable From A Server Function
const getGreeting = createServerFn({ method: "GET" }).handler( () => process.env.GREETING ?? "Hello!",);Vinext
Section titled “Vinext”Source:
src/Fly/Website/Vinext.ts
Deploy a vinext application to Fly as a
long-running Node process: vinext’s Vite build, then vinext’s production
server (startProdServer). The dist/ output is baked into the
image; vinext is installed unbundled.
Do not use the Cloudflare Worker entry (vinext/server/fetch-handler)
— that is workerd.
ISR / "use cache" persist in Redis when you pass VinextProps.redis.
The resource injects the adapter automatically. Missing REDIS_URL
(local vinext start / alchemy dev) falls back to memory.
During alchemy dev the site is vinext dev and no cloud resources
are declared; Alchemy.remote() opts back into the live Service path.
Vinext: Creating vinext Sites
Section titled “Vinext: Creating vinext Sites”Basic vinext App
const site = yield* Fly.Website.Vinext("Web", { rootDir: "./app",});Redis data cache
const redis = yield* Fly.Redis("Cache", { eviction: true });const site = yield* Fly.Website.Vinext("Web", { redis,});Custom Domain
const site = yield* Fly.Website.Vinext("Web", { rootDir: "./app", domain: "app.example.com",});Source:
src/Fly/Website/Vite.ts
Deploy a plain Vite application to Fly: a Service
serving the vite build output from a tiny static-file server. For
client-only projects — React/Vue/Solid SPAs, index.html multi-page
apps — whose entire deployable output is static assets.
The build runs through @alchemy.run/frontend-frameworks/vite with the
@alchemy.run/frontend-frameworks/vite/node deploy target — the package
must be installed in your project. Your project’s own vite.config.*
(plugins included) drives the build.
During alchemy dev the site is Vite’s own dev server (native HMR) and
no cloud resources are created — the site’s url is the dev server’s
local address. Alchemy.remote() opts back into the full deployment.
Vite: Creating Vite Sites
Section titled “Vite: Creating Vite Sites”Basic Vite SPA
const site = yield* Fly.Website.Vite("Web");Project in a Subdirectory
const site = yield* Fly.Website.Vite("Web", { rootDir: "./app",});Existing App
const site = yield* Fly.Website.Vite("Web", { app: Site });Vite: Multi-Page Sites
Section titled “Vite: Multi-Page Sites”const site = yield* Fly.Website.Vite("Docs", { assets: { notFoundHandling: "404-page" },});Vite: Custom Domain
Section titled “Vite: Custom Domain”const site = yield* Fly.Website.Vite("Web", { domain: "app.example.com",});Vite: Build Configuration
Section titled “Vite: Build Configuration”const site = yield* Fly.Website.Vite("Docs", { vite: { outDir: "build", base: "/docs/" },});Vite: Local Development
Section titled “Vite: Local Development”// `alchemy dev` starts `vite` programmatically: site.url is the local// dev server (HMR included); no Fly App or Service is created.const site = yield* Fly.Website.Vite("Web");Source:
src/Fly/Website/Vocs.ts
Deploy a Vocs documentation site to Fly. The node
target serves static assets first, then Vocs’ Waku RSC handler
(/about → about/index.html, otherwise SSR).
Vocs: Creating Vocs Sites
Section titled “Vocs: Creating Vocs Sites”Vocs documentation site
const docs = yield* Fly.Website.Vocs("Docs", { rootDir: "./docs",});Custom output directory
const docs = yield* Fly.Website.Vocs("Docs", { rootDir: "./docs", outDir: "build",});Source:
src/Fly/Website/Waku.ts
Deploy a Waku application to Fly: the RSC server on a
Machine, static assets (SSG pages included) baked into the image.
Prerendered pages are served extensionless (/about).
Waku: Creating Waku Sites
Section titled “Waku: Creating Waku Sites”Basic Waku App
const site = yield* Fly.Website.Waku("Web", { rootDir: "./app",});Custom Domain
const site = yield* Fly.Website.Waku("Web", { rootDir: "./app", domain: "app.example.com",});