Routing
One of the coolest things about the Request/Response API is that it works with modern web frameworks, so you can use routing and their helper methods! When an
HTTP val is deployed, it is available at a subdomain like
handle-valname.web.val.run
, and requests to any subdirectory
or path will be routed to the val.
Hono
Here’s an example with Hono:
Peko
And one with Peko:
nhttp
And nhttp:
itty-router
A super tiny example with itty-router:
feTS
A simple example of using feTS server:
Notice, that it exports the router
, which allows to use the feTS client to make routes type safe: