a minimal, batteries-included web framework for deno. it provides a type-safe routing core, a composable middleware system with automatic dependency resolution, and native streaming primitives
- tiny core, built entirely on top of deno's
@std/* - declarative middleware with priority tiers and automatic dependency resolution
- flexible type-safe routing with first-class support for path parameters, route groups, and wildcard methods w/ full inference :3
- chainable context helpers and type-safe request/response handling
- composable middleware stack with built-in support for CORS, logging, security headers, rate limiting
- ETag caching (weak + strong),
Rangerequests, dotfile protection, and streaming responses - first-class SSE and WebSocket support with abort-safe async iterables
- lightweight server-side rendering with escaping, style objects, and fragment support
- automatic JSON, form-urlencoded, and multipart file upload handling with size limits
- CORS, CSP, HSTS, referrer policy, and rate limiting as composable middleware
- global error handling and cookie jar management
import { createRouter, logger } from "@july/snarl";
const app = createRouter();
app.use(logger());
app.get("/", (ctx) => {
return ctx.html(
<html>
<head>
<title>example paige</title>
</head>
<body>
<h1>welcom</h1>
<p>i meant page* haiiiii</p>
</body>
</html>,
);
});
app.get("/users/:id", (ctx) => {
const { id } = ctx.params;
return ctx.json({ user: id });
});
app.post("/users", async (ctx) => {
const body = await ctx.body.json();
return ctx.created(body);
});
app.serve();| Package | Description |
|---|---|
| @july/snarl | core: router, middleware, jsx, streaming |
| @404/imouto | file-based routing, layout composition, app boilerplate |
| @404/aether | islands architecture, reactivity, client bundling |
| @404/varnish | response post-processing: minification, scoped CSS |