Server Side Routing

TypePath lets you call method functions directly on the router object. This is useful for server side routing.

Example

const r = router({
  "/": get((ctx) => {
    // ...
  }),
});

r.get("/", {
  search: { "q": "hello" },
});

Request

const r = router({
  "/": get((ctx) => {
    // ...
  }),
});

let res = await r.handle(new Request(...));

res // Response