Waku provides a router built on top of the minimal API, and it serves as a reference implementation. While other router implementations can be used with Waku, this page focuses on the
waku/router implementation.waku/router implementation.Router component instead of using serve directly. The following code demonstrates how to use the Router component as the root component:Router component internally uses serve and handles nested routes.entries.ts, we use defineRouter to export getEntry and getBuildConfig at once. Here's a simple example code without builder:defineRouter is config-based. However, it isn't too difficult to make a file-based router. Here's a file-based example code with builder:npm create waku@latest and copy files from the example folder in the repository.