Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sinclairnick/webroute
πΈοΈ Web APIs, from the route up
https://github.com/sinclairnick/webroute
client http openapi schema trpc typescript web web-standards
Last synced: 4 days ago
JSON representation
πΈοΈ Web APIs, from the route up
- Host: GitHub
- URL: https://github.com/sinclairnick/webroute
- Owner: sinclairnick
- License: mit
- Created: 2024-01-28T07:51:08.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-26T10:05:20.000Z (4 months ago)
- Last Synced: 2024-08-27T09:18:53.126Z (4 months ago)
- Topics: client, http, openapi, schema, trpc, typescript, web, web-standards
- Language: TypeScript
- Homepage: https://webroute.vercel.app/docs
- Size: 1.67 MB
- Stars: 54
- Watchers: 2
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Webroute
Web APIs, from the route-up.## Overview
Webroute helps you build self-sufficient, web-standard routes that have everything they need: path, method, I/O shape and validation, middleware and request handler.
It was invented to make building sophisticated APIs easier in the diverse ecosystem of serverless (but also serverful) full-stack and backend development.
### Inspiration
Webroute was heavily inspired by tRPC, but built specifically for HTTP. So if you're a fan of either, you'll probably like webroute.
## Features
- π Unopinionated and minimal API, by design
- π End-to-end type safety (including middleware)
- β First-class validation and schema support
- πΈοΈ HTTP based
- π Works well with serverless routes
- π³ ...or monolithic backends## Example Usage
A basic webroute might look something like this:
```ts
import { route } from "@webroute/route";const myRoute = route("/user/:id")
.use(authMiddleware)
.params(z.object({ id: z.string() }))
.handle(async (req) => {
// ...do work
});
```Which is just a regular web-standard request handler:
```ts
const response = myRoute(new Request("..."));
```Being web-standard and self-sufficient, it can be used directly, with no modification, with popular frameworks like `Next.js`, and `Hono` or within runtimes like `bun`, `deno` and node.
Read the [Quick Start](https://webroute.vercel.app/docs/building-apps/quick-start).
## What's in the box?
Webroute provides the functionality of a full-blown framework, without being one. Instead, it offers a handful of packages which can be selectively installed to fill in the gaps, when your use case requires it.
Webroute is "full-stack", in the sense it provides utilities and patterns for both the client-side and server-side. However, these client- and server-side tools are not dependent on the other - one can be used without the other.
## Compatibility
Webroute works with all runtimes or frameworks that conform to the WinterCG Minimum Web Standard.
### Frameworks
- [x] `Hono`
- [x] `Next.js`
- [x] `Remix`
- [x] `SolidStart`
- [x] `SvelteKit`### Runtimes
- [x] `Bun`
- [x] `Deno`
- [x] `Node` (via adapter)
- [x] `Cloudflare Workes`
- [x] `Vercel Edge`