An open API service indexing awesome lists of open source software.

https://github.com/perongh/server-router

Minimalistic router for Deno HTTP server.
https://github.com/perongh/server-router

Last synced: about 2 months ago
JSON representation

Minimalistic router for Deno HTTP server.

Awesome Lists containing this project

README

        

# Server Router

Server Router is a minimalistic router for Deno. It is designed with web standards in mind, and is intended to be used with the [Deno HTTP server](https://deno.land/std/http/server.ts).

### Example

```ts
import { serve } from "https://deno.land/std/http/server.ts";
import { ServerRouter } from "https://deno.land/x/server_router/mod.ts";

const router = new ServerRouter();

router
.caseSensitive()
.route("/", (_req) => new Response("Hello World!"))
.route("/api/hi", (_req) => new Response("Hi, API!"));

await serve(router.handler);
```