What is Senri
A small web framework written only with the web-standard Request and Response
Senri is a small web framework written only with the web-standard Request and Response. The same code runs on Bun, Node.js, Deno, Cloudflare Workers and the browser (Service Worker).
import { } from "@senrijs/senri";
import { } from "@senrijs/senri/dev";
import { } from "@senrijs/senri/serve";
const = ({ : () });
.("/hello", () => "Hello"); // string → text/plain
.("/users/:id", ({ id }) => ({ })); // object → JSON
await (); // on Bun, Node.js and DenoFeatures
- What you return becomes the response. A string becomes text and an object becomes JSON. You can also return a
Responseas is - Types come from the path. Write
/users/:idand the handler'sidis typed. You can check parameters, the query and the body with Standard Schema (Zod, Valibot, ArkType and others) - A helpful development mode. Error pages show the code where the error happened and hints. 404 pages show "did you mean". The
/_senridashboard shows how each request went through the middleware - Runs anywhere. It uses only web-standard APIs, with no
evaland nonew Function - Small. A minimal app bundles to about 7 KB after gzip. The development-mode code does not go into production builds