Skip to content

Fly.Website reference

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.

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",
});
const site = yield* Fly.Website.Astro("Docs", {
rootDir: "./docs",
astro: { output: "static" },
assets: { notFoundHandling: "404-page" },
});

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 app

const site = yield* Fly.Website.Foldkit("Web");

Project in a subdirectory

const site = yield* Fly.Website.Foldkit("Web", {
rootDir: "applications/web",
});
const site = yield* Fly.Website.Foldkit("Web", {
assets: { notFoundHandling: "404-page" },
});

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.

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.

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",
});

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.

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",
});

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.

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",
});

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

app/routes/home.tsx
export function loader() {
return { greeting: process.env.GREETING ?? "Hello!" };
}

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.

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",
});
const site = yield* Fly.Website.SolidStart("Web", {
rootDir: "./app",
env: {
GREETING: "Hello from SolidStart on Fly!",
},
});

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"] } },
});

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

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" },
});
const site = yield* Fly.Website.StaticSite("Web", {
path: "apps/web",
build: { command: "npm run build", output: "dist" },
});
const site = yield* Fly.Website.StaticSite("App", {
build: { command: "npm run build", output: "dist" },
dev: { command: "npm run dev" },
});

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.

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",
});

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",
});

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

src/routes/index.tsx
const getGreeting = createServerFn({ method: "GET" }).handler(
() => process.env.GREETING ?? "Hello!",
);

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.

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.

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 });
const site = yield* Fly.Website.Vite("Docs", {
assets: { notFoundHandling: "404-page" },
});
const site = yield* Fly.Website.Vite("Web", {
domain: "app.example.com",
});
const site = yield* Fly.Website.Vite("Docs", {
vite: { outDir: "build", base: "/docs/" },
});
// `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 (/aboutabout/index.html, otherwise SSR).

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

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",
});