go-ozzo / ozzo-routing

An extremely fast Go (golang) HTTP router that supports regular expression route matching. Comes with full support for building RESTful APIs.
MIT License
455 stars 51 forks source link

Serving Static Html file for not found endpoints. #52

Open tonespy opened 6 years ago

tonespy commented 6 years ago

I was going through the documentation and I saw the explanation given about error handling.

What I am trying to achieve is being able to return an html file in a situation where the endpoint is not provided. I wanted to just go ahead and add my function for 404/not found errors.

But, I was concerned about it interfering with situations where I return a 404 itself. E.g: When a user makes a request to get information about a user and the user isn't available.

Your response and suggestion would be greatly appreciated.

Thanks