Skip to main content
Workloads

Frontends & Static Sites

Serve an HTML, CSS, and JavaScript site from a public/ folder in a generated app.

Prefer to read code? Clone the example repository. View on GitHub

Example generated code

Deploy and route

Deploy the directory and open /apps/static-website/:

// Deploy the site directory. Its package.json and src/index.ts serve public/.
await deployApp({
	appId: "static-website",
	source: new URL("../fixtures/app/", import.meta.url),
});

Directories that contain only static files are rejected. Every app needs a package.json and an entrypoint that default-exports a fetch handler.