Skip to content

DigitalOcean.Website reference

Source: packages/digitalocean/src/Website/Astro.ts

Deploy an Astro application to DigitalOcean App Platform: the Node adapter bundle as a App Platform service, static assets baked into the unit. Pages render on demand by default (output: "server"); output: "static" in your astro.config.* or astro: { output: "static" } prerenders every page and deploys assets-only.

The build runs through @alchemy.run/frontend-frameworks/astro with the @alchemy.run/frontend-frameworks/astro/node deploy target. Your astro.config.* must not declare an adapter.

const site = yield* DigitalOcean.Website.Astro("Web", {
rootDir: "./app",
});
const site = yield* DigitalOcean.Website.Astro("Docs", {
rootDir: "./docs",
astro: { output: "static" },
assets: { notFoundHandling: "404-page" },
});

Source: packages/digitalocean/src/Website/Foldkit.ts

Deploy a Foldkit application to DigitalOcean Cloud. Browser-only apps use SPA routing. With ssr.build enabled in the Foldkit Vite plugin, prerendered pages and assets are served first, followed by Foldkit’s generated request handler for SSR and hybrid routes.

The build uses @alchemy.run/frontend-frameworks/foldkit and the project’s Vite configuration. No application adapter is required. Native Foldkit development and live reload run without cloud resources; Alchemy.remote() opts into a live deployment during development.

const site = yield* DigitalOcean.Website.Foldkit("Web", {
rootDir: "./app",
});
const site = yield* DigitalOcean.Website.Foldkit("Web", {
rootDir: "./app",
env: { API_BASE: "https://api.example.com" },
});

Source: packages/digitalocean/src/Website/Nextjs.ts

Deploy a Next.js application to a DigitalOcean App Platform: next build then a long-running next({ dev: false }) App Platform service. Does not use OpenNext (those wrappers are Lambda/workerd).

The .next output (and public/ when present) is packed into the unit archive. next, react, and react-dom are installed on the unit with npm install rather than bundled.

During alchemy dev the site is next dev and no cloud resources are declared; Alchemy.remote() opts back into the live Service.

const site = yield* DigitalOcean.Website.Nextjs("Web", {
rootDir: "./app",
});

Source: packages/digitalocean/src/Website/Nuxt.ts

Deploy a Nuxt application to a DigitalOcean App Platform: the nitro Node server as a App Platform service, static assets baked into the unit.

The build runs through @alchemy.run/frontend-frameworks/nuxt with the @alchemy.run/frontend-frameworks/nuxt/node deploy target (nitro.preset "node").

const site = yield* DigitalOcean.Website.Nuxt("Web", {
rootDir: "./app",
});

Source: packages/digitalocean/src/Website/Octane.ts

Deploy an OctaneJS application to a DigitalOcean Cloud Server: Octane’s SSR server as a App Platform service, static assets baked into the unit.

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

const site = yield* DigitalOcean.Website.Octane("Web", {
rootDir: "./app",
});

Source: packages/digitalocean/src/Website/ReactRouter.ts

Deploy a React Router v7 app (framework mode) to a DigitalOcean App Platform: the SSR server as a App Platform service, static assets baked into the unit.

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 makes the server pass’s build input a module that wraps the manifest with createRequestHandler and packages the resulting fetch handler as a Node HTTP server.

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.

const site = yield* DigitalOcean.Website.ReactRouter("Web", {
rootDir: "./app",
});

Process Environment

const site = yield* DigitalOcean.Website.ReactRouter("Web", {
rootDir: "./app",
env: {
API_BASE: "https://api.example.com",
},
});

Read An Environment Variable From A Loader

app/routes/home.tsx
export function loader() {
return { apiBase: process.env.API_BASE ?? "unset" };
}

Source: packages/digitalocean/src/Website/SolidStart.ts

Deploy a SolidStart application to a DigitalOcean App Platform: the SSR server as a App Platform service, static assets (prerendered pages included) baked into the unit.

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.

const site = yield* DigitalOcean.Website.SolidStart("Web", {
rootDir: "./app",
});
const site = yield* DigitalOcean.Website.SolidStart("Web", {
rootDir: "./app",
env: {
API_BASE: "https://api.example.com",
},
});

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 unit and served as static assets.

const site = yield* DigitalOcean.Website.SolidStart("Web", {
rootDir: "./app",
nitro: { prerender: { routes: ["/", "/about"] } },
});

Source: packages/digitalocean/src/Website/StaticSite.ts

A DigitalOcean App that serves static files built by a shell command (Hugo, Jekyll, Eleventy, a hand-written dist/). The output is baked into the App’s image with a small static-file server. It runs as an App service because Spaces has no index documents or single-page fallback, and App Platform’s static sites build only from a git repository.

For Vite-based projects, prefer DigitalOcean.Website.Vite.

A Hugo blog

const site = yield* DigitalOcean.Website.StaticSite("Blog", {
command: "hugo --minify",
outdir: "public",
});

A single-page app

const site = yield* DigitalOcean.Website.StaticSite("App", {
command: "npm run build",
outdir: "dist",
spa: true,
});

Source: packages/digitalocean/src/Website/SvelteKit.ts

Deploy a SvelteKit application to a DigitalOcean App Platform: kit’s SSR server as a App Platform service, static assets (prerendered pages included) baked into the unit.

The build runs through @alchemy.run/frontend-frameworks/sveltekit with the @alchemy.run/frontend-frameworks/sveltekit/node deploy target.

const site = yield* DigitalOcean.Website.SvelteKit("Web", {
rootDir: "./app",
});

Source: packages/digitalocean/src/Website/TanStackStart.ts

Deploy a TanStack Start application to a DigitalOcean App Platform: the SSR server as a App Platform service, static assets baked into the unit.

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.

TanStackStart: Creating TanStack Start Sites

Section titled “TanStackStart: Creating TanStack Start Sites”
const site = yield* DigitalOcean.Website.TanStackStart("Web", {
rootDir: "./app",
});

Process Environment

const site = yield* DigitalOcean.Website.TanStackStart("Web", {
rootDir: "./app",
env: {
API_BASE: "https://api.example.com",
},
});

Read An Environment Variable From A Server Function

src/routes/index.tsx
const getApiBase = createServerFn({ method: "GET" }).handler(() => ({
apiBase: process.env.API_BASE,
}));

Source: packages/digitalocean/src/Website/Vinext.ts

Deploy a vinext application to DigitalOcean App Platform: vinext’s Vite build then a long-running startProdServer App Platform service. Does not use the Cloudflare Worker entry (vinext/server/fetch-handler).

The dist/ output is packed into the unit archive. vinext, react, react-dom, and react-server-dom-webpack are installed on the unit with npm install rather than bundled.

During alchemy dev the site is vinext dev and no cloud resources are declared; Alchemy.remote() opts back into the live Service.

Basic vinext App

const site = yield* DigitalOcean.Website.Vinext("Web", {
rootDir: "./app",
});

Redis data cache

ISR / "use cache" default to in-process memory. Set env.REDIS_URL on this resource for a durable Redis store; the adapter is injected automatically.

const site = yield* DigitalOcean.Website.Vinext("Web", {
env: {
REDIS_URL: "redis://cache.internal:6379",
},
});

Source: packages/digitalocean/src/Website/Vite.ts

Deploy a plain Vite application to DigitalOcean App Platform: vite build output served by a static-file App Platform service. 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. During alchemy dev the site is Vite’s own dev server and no cloud resources are created.

Basic Vite SPA

const site = yield* DigitalOcean.Website.Vite("Web");

Project in a Subdirectory

const site = yield* DigitalOcean.Website.Vite("Web", {
rootDir: "./app",
});
const site = yield* DigitalOcean.Website.Vite("Docs", {
assets: { notFoundHandling: "404-page" },
});
const site = yield* DigitalOcean.Website.Vite("Docs", {
outDir: "build",
base: "/docs/",
});
// `alchemy dev` starts `vite` programmatically: site.url is the local
// dev server (HMR included); no Server or Service is created.
const site = yield* DigitalOcean.Website.Vite("Web");

Source: packages/digitalocean/src/Website/Vocs.ts

Deploy a Vocs documentation project to a DigitalOcean Cloud Server. Static assets first, then Vocs’ Waku RSC handler (/about → about/index.html, otherwise SSR).

Vocs Documentation Site

const docs = yield* DigitalOcean.Website.Vocs("Docs", {
rootDir: "./docs",
});

Custom Output Directory

const docs = yield* DigitalOcean.Website.Vocs("Docs", {
rootDir: "./docs",
outDir: "build",
});

Source: packages/digitalocean/src/Website/Waku.ts

Deploy a Waku application to a DigitalOcean App Platform: the RSC server as a App Platform service, static assets (SSG pages included) baked into the unit. Prerendered pages are served extensionless (/about not /about/).

const site = yield* DigitalOcean.Website.Waku("Web", {
rootDir: "./app",
});