Home Documentation Templates Examples Showcase GitHub ↗
Theme

Platform target

Cloudflare Pages

Cloudflare Pages can deploy Nift's normal public/ output. The target adds Wrangler configuration that declares the Pages build-output directory.

nift init --target=cloudflare

What Nift creates

name = "nift-site"
pages_build_output_dir = "./public"

Change the project name before deployment. A Wrangler file with pages_build_output_dir can serve as Pages project configuration; ordinary Nift builds continue to own only public/.

Build and direct upload

For Git integration, configure the build environment so nift build runs and produces public/. For direct-upload workflows, build first and deploy the resulting directory with Wrangler.

Pages Functions

Pages Functions execute server-side code on the Workers runtime. A conventional Functions project can live in a top-level functions/ directory beside the Nift site. Routing can be narrowed with Pages' function-routing configuration.

Bindings

Pages Functions can bind to Cloudflare platform resources including KV, D1, R2 and Durable Objects. Those bindings belong in Cloudflare configuration; Nift remains unaware of their runtime semantics.

Cloudflare is evolving.

Cloudflare also documents migration from Pages to Workers static assets. This target intentionally names the current Pages workflow; use the Workers model instead when that is the architecture you actually want.

Official references: Pages build configuration, Wrangler configuration, Pages Functions, and bindings.

Next platformGitHub Pages →