an icon of an acorn

A RESTful server framework for JavaScript and TypeScript

acorn is a RESTful server framework for handling HTTP requests across Deno, Node.js, Bun and Cloudflare Workers.

deno add @oak/acorn
npx jsr add @oak/acorn
yarn dlx jsr add @oak/acorn
pnpm dlx jsr add @oak/acorn
bunx jsr add @oak/acorn
import { Router } from "@oak/acorn";

const BOOKS = {
  "1": { id: 1, title: "The Hound of the Baskervilles" },
  "2": { id: 2, title: "It" },
};

const router = new Router();

router.get("/", () => ({ hello: "world" }));
router.get("/books/:id", (ctx) => BOOKS[ctx.params.id]);

router.listen({ port: 3000 });

Rapidly create endpoints

acorn focuses on the primary use case of handling JSON data in a RESTful way, with a focused and familiar router API.

See the docs