Standalone API
Build standalone, zero-host HTTP APIs with pure Taser.js, Vite, and Nitro. Maximum throughput, zero boilerplate, and web-standard Request/Response execution.
The Standalone architecture is the default and recommended way to build backend services with Taser.js. In this mode, you do not need Express, Fastify, or any other host web framework.
Taser.js handles request dispatching, middleware pipelines, input validation, and responses directly using high-performance web standards.
Why Standalone?
Zero Host Overhead
Eliminates intermediate framework wrappers. Requests pass directly into Taser.js's compiled radix tree.
Web Standards First
Handlers interact with native Request, Response, Headers, and Cookies objects.
Deploy Anywhere
Change a single preset in nitro.config.ts to deploy to Cloudflare, Vercel, Node, Bun, Deno, or AWS Lambda.
Instant Dev HMR
Vite loads routes virtually with instantaneous hot-module replacement on file creation or edits.
Quickstart
1. Scaffold a Standalone Project
pnpm create taserjs@latest my-api --framework none --preset node-server -y2. Project Files
A standalone project contains no host server files. Import the compiled app from the generated manifest when you need a programmatic entry:
my-api/
├── vite.config.ts # Plugins: [taser(), nitro()]
├── nitro.config.ts # Deployment preset
├── src/
│ ├── taser.ts # defineTaser() definition (TaserDefinition)
│ ├── context.ts # Boot and request context
│ ├── routes/ # File-based endpoints
│ └── .taserjs/
│ └── routes.gen.ts # export { app } — runnable Hono instance
└── package.jsonimport { app } from "./.taserjs/routes.gen.js";
// app is the compiled Hono instance produced from defineTaser() + your routes
export default app;4. Build for Production
pnpm buildDepending on your deployment mode, Taser.js packages your output into .output/ (with Nitro presets) or dist/ (with standalone Vite).
Related Guides
Security and Utility Middlewares
Discover built-in middlewares for security headers, CSRF defense, body size limits, ETags, Server-Timing, and response compression.
Native Fetch Frameworks
Run Taser.js alongside any Web Standard or Fetch-native host framework (Hono, Elysia, HatTip, or native Web Fetch handlers) using host pass-through dispatching.