Cloudflare Workers provides globally distributed, low-latency hosting for nano. When nano detects that it is being built for Cloudflare, it automatically switches to theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/mohameodo/nano/llms.txt
Use this file to discover all available pages before exploring further.
@astrojs/cloudflare adapter, compiling the app into a _worker.js bundle that runs natively in the Workers runtime. The repository ships a wrangler.toml that pre-configures the Workers deployment — static assets are served via the Workers Assets feature, with no separate Pages project required.
How nano Detects Cloudflare
Theastro.config.mjs adapter selection checks three environment variables at build time:
CF_PAGES=1— set by Cloudflare Pages CI automaticallyCLOUDFLARE=1— set this manually when deploying to WorkersWORKERS_CI=1— alternative flag for Workers CI pipelines
@astrojs/cloudflare instead of the default Node adapter. You must set at least one of them when building locally for a Cloudflare target.
wrangler.toml
The repository includes awrangler.toml for deploying via the Wrangler CLI:
main— points to the compiled Worker entry file produced bypnpm build.compatibility_flags = ["nodejs_compat"]— enables Node.js compatibility APIs in the Workers runtime (required for Astro’s Cloudflare adapter).keep_vars = true— preserves existing Worker variables during deploys so secrets set in the Cloudflare dashboard are not overwritten.[assets]— serves the static files from thedist/directory alongside the Worker.[vars]— setsPORTandHOSTas Worker environment variables. Additional runtime variables can be added here or configured in the Cloudflare dashboard.
Deploy to Cloudflare
Install Wrangler
Wrangler is already listed as a dev dependency in nano. If it is not yet installed, add it:Verify it is available:
Set the Cloudflare build flag
Before building, set the environment variable that tells nano to use the Cloudflare adapter:
Build the app
dist/_worker.js and copies static assets to dist/.Configuring Environment Variables
Runtime variables for Cloudflare Workers can be set in two places:wrangler.toml[vars]section — for non-secret, version-controlled variables.- Cloudflare dashboard → Workers & Pages → Settings → Environment Variables — for secrets such as
TMDB_API_KEY.
wrangler.toml or the dashboard before deploying:
Limitations on Cloudflare
Remote stream proxying through
/api/proxy works correctly on Cloudflare. TMDB metadata lookups, search, and all UI features work as expected. Only features that require local filesystem access or native Node.js modules are restricted.