https://github.com/seamapi/edgespec
☃️ an API framework for everywhere.
https://github.com/seamapi/edgespec
maintained
Last synced: 2 months ago
JSON representation
☃️ an API framework for everywhere.
- Host: GitHub
- URL: https://github.com/seamapi/edgespec
- Owner: seamapi
- License: mit
- Created: 2023-11-12T19:01:00.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-23T22:14:55.000Z (about 1 year ago)
- Last Synced: 2025-01-28T03:13:06.949Z (11 months ago)
- Topics: maintained
- Language: TypeScript
- Homepage:
- Size: 881 KB
- Stars: 5
- Watchers: 5
- Forks: 2
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# ☃️ edgespec
EdgeSpec 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](https://github.com/wintercg/proposal-common-minimum-api), 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.
## Getting Started
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](./recipes/adding-edgespec-to-existing-project.md)
## Usage
- [Routes](./docs/routes.md) ⭐
- [Middleware](./docs/middleware.md)
- [Global route config](./docs/global-route-config.md)
- [Code generation (typings & OpenAPI)](./docs/code-generation.md)
- [EdgeSpec config](./docs/edgespec-config.md)
- [Bundling & deployment](./docs/bundling-and-deployment.md) 🚀
- [Embedding as a module](./docs/embedding.md)
- [Programmatic usage](./docs/programmatic-usage.md)
## Alternatives
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](https://nextjs.org/) with React Server Components
- [Remix](https://remix.run/)
- [Express](http://expressjs.com/) or [Fastify](https://fastify.dev/) with [tRPC](https://trpc.io/)
- If you dislike filepath-based routing and need to run within a WinterCG-compatible environment:
- [Hono](https://hono.dev/) (with or without [tRPC](https://trpc.io/))
- If you enjoy dependency injection:
- [NestJS](https://nestjs.com/)
- If your project is mainly frontend with a few API routes:
- [Next.js](https://nextjs.org/)