For some middleware to work, we need a default handler to be returned if a path is not present in the router. This means we could also allow users to customize what happens when a route isn't found as a custom handler.
For example, the static middleware needs to be called regardless if the path has an associated route or not. So returning a route not found handler could help with implementing the static middleware.
Description
For some middleware to work, we need a default handler to be returned if a path is not present in the router. This means we could also allow users to customize what happens when a route isn't found as a custom handler.
For example, the static middleware needs to be called regardless if the path has an associated route or not. So returning a route not found handler could help with implementing the static middleware.
Technically, there already is a default "route not found" but it is not a handler, it is just a prebuilt response. See https://github.com/AlexCouch/pluvo/blob/master/src/pluvo.gleam#L37-L39