Getting Started
Build web-standard servers with context-based handlers, middleware, and runtime adapters.
Install
npm i sevok
yarn add sevok
pnpm i sevok
bun i sevok
deno i npm:sevok
Quick Start
Create a server entry:
server.ts
import { serve } from "sevok";
import { NodeRuntimeAdapter } from "sevok/node";
serve({
adapter: new NodeRuntimeAdapter(),
fetch() {
return Response.json({ hello: "world" });
},
});
Run it with Node.js:
node --experimental-strip-types server.ts
Quick Start with CLI
Create a default entry file:
server.ts
export default {
fetch() {
return new Response("Hello from sevok");
},
};
Then run:
npx sevok
yarn dlx sevok
pnpm dlx sevok
bunx sevok
deno run -A npm:sevok
Or after installation, run the installed binary directly:
sevok
The CLI will look for common entry names such as:
server.tsserver.mjssrc/server.tssrc/server.mjs
If your entry uses another name or extension, pass it explicitly:
sevok --entry ./server.tsx --import jiti/register
Runtime Adapters
sevok keeps request handling runtime-agnostic. You provide an adapter for the
host environment you want to run on.
sevok/nodesevok/bunsevok/denosevok/stream
Main Exports
import {
Server,
ServerServeEvent,
ServerCloseEvent,
ServerErrorEvent,
serve,
createContextKey,
} from "sevok";
import { log } from "sevok/log";
import { serveStatic } from "sevok/static";
import { StreamRuntimeAdapter } from "sevok/stream";
Examples
The repository includes runnable examples under examples/:
examples/basic/node.tsexamples/basic/bun.tsexamples/basic/deno.tsexamples/basic/stream.tsexamples/jsx/server.tsx