SaturnFramework / Saturn

Opinionated, web development framework for F# which implements the server-side, functional MVC pattern
https://saturnframework.org
MIT License
703 stars 108 forks source link

Endpoint router does not have concept of NotFoundHandler #336

Open nojaf opened 2 years ago

nojaf commented 2 years ago

Hello,

I noticed that the Router.fs has a concept of not_found_handler but RouterEndpoint.fs does not. Is this by design? What would the alternative be for not_found_handler for endpoint routing?

dredgy commented 2 years ago

This is explained here

https://saturnframework.org/explanations/endpoint-routing.html

Lack of not_found_handler in router and controller - as Endpoint Routing creates global table of routing having scoped not-found handlers is really tricky. Use built-in ways of handle 404 in ASP.NET (such as UseDeveloperExceptionPage)