import*as http from'node:http' import{ RequestRouter }from'keywork/router' import{ createServerHandler }from'keywork/router/node' // Create a router as you usually do... const router =newRequestRouter() router.get('/',()=>'Hello from Node') // And then wrap the router with `createServerHandler` http.createServer(createServerHandler(router))
caution
Node support is currently experimental and may change in the near future.
The
RequestRouter
can be made compatible with Node.js via thecreateServerHandler
wrapper function:Node support is currently experimental and may change in the near future.