Write Winter-CG compatible routes with filesystem routing and tons of features
npm install edgespecEdgeSpec is an opinionated HTTP framework for TypeScript. Out of the box, it:
- Uses filepath-based routing
- [Soon] generates ergonomic SDKs across multiple languages
- [Soon] generates OpenAPI documentation
- Provides end-to-end type safety for your middleware and endpoints
- Can be built into a zero-dependency module and embedded into other applications
EdgeSpec primarily targets the common minimum API described by WinterCG, but it can also target Node.js, Bun, and Deno. Currently, the two main "edge"/WinterCG-compatible platforms targeted are Cloudflare Workers and Vercel Edge Functions.
Regardless of your target, EdgeSpec provides a consistent API and encourages emulation of the WinterCG runtime when developing.
To start a new project:
``bash
npm create edgespec@latest # [soon]
npm run dev
``
If you want to add EdgeSpec to an existing project, check out this recipe
- Routes ⭐
- Middleware
- Global route config
- Code generation (typings & OpenAPI)
- EdgeSpec config
- Bundling & deployment 🚀
- Embedding as a module
- Programmatic usage
EdgeSpec may not be the right choice for your project. This list is not exhaustive, but here are some alternatives:
- If your backend and frontend are tightly coupled:
- Next.js with React Server Components
- Remix
- Express or Fastify with tRPC
- If you dislike filepath-based routing and need to run within a WinterCG-compatible environment:
- Hono (with or without tRPC)
- If you enjoy dependency injection:
- NestJS
- If your project is mainly frontend with a few API routes:
- Next.js