For Worker::Router, how to implement a fallback URL?
I have been using Axum up until now with a fallback URL pointing to a custom template. Trying to strip Axum out now and the only issue I've had is rendering that custom 404 page.
Looking at the code it seems like the router is designed to just throw an error if no matches for routes exists:
https://github.com/cloudflare/workers-rs/blob/2d022abb219a06e5e53c87793b135e24adc55e45/worker/src/router.rs#L416
I assume there's some worker specific config to make this work but I'm not finding it. Would really appreciate guidance on this.
0 条评论