Skip to main content
Blaze is a lightweight web framework purpose-built for Cloudflare Workers. It brings the ergonomics you already know from Express — (req, res, next) middleware, Router, and route chaining — to the Cloudflare platform without sacrificing performance or type safety. You get zero npm dependencies in the core, O(log n) route matching via a hand-rolled TrieRouter, and first-class access to every Cloudflare primitive (req.env.KV, req.env.DB, req.ctx.waitUntil()) directly from the request object. If you want to ship APIs on Cloudflare Workers without learning an entirely new paradigm, Blaze is built for you.

Quickstart

Get a Worker running in minutes with a JSON endpoint and live hot-reload.

Core Concepts

Understand the app, routing, request, and response primitives.

Middleware

Explore the 12 built-in, tree-shakeable middleware modules.

Cloudflare Bindings

Access KV, D1, R2, Queues, AI, and Durable Objects natively.

Get up and running

1

Install Blaze

Add Blaze to your project with your preferred package manager.
2

Create the app

Pass your Env type to createApp<Env>() — this flows TypeScript types to every req.env call throughout your app.
3

Register routes

Use the Express-style HTTP method helpers — app.get, app.post, app.put, app.delete, and more — to define your endpoints.
4

Export the fetch handler

Export fetch: app.fetch as your Cloudflare Workers entry point. Optionally export scheduled: app.scheduled for cron triggers.

Why developers choose Blaze

O(log n) Router

A hand-rolled TrieRouter delivers O(log n) route matching that scales cleanly regardless of how many routes you register — no linear-scan cliff.

Express Parity

The (req, res, next) middleware signature is identical to Express, so your existing knowledge and compatible middleware packages transfer directly.

Fully Typed

The Env generic on createApp<Env>() propagates through the entire app — every req.env property is type-safe with zero casting.

Zero Dependencies

The Blaze core has no npm runtime dependencies. The TrieRouter, middleware compose, and response helpers are all hand-rolled.

12 Built-in Middleware

A tree-shakeable suite covering CORS, auth, JWT, rate limiting, caching, compression, ETag, security headers, and more — imported only when you need them.

CF-Native Bindings

KV, D1, R2, Durable Objects, Queues, and Workers AI are all reachable from req.env with full TypeScript types and zero boilerplate.