steiza/txroutes — pull request #5 by mjpizz (2013-12-11 19:43:10+00:00)
Title: Allow subclasses to override 404 behavior

Right now, txroutes assumes that all endpoints should return HTML. This is not the case for many APIs, which might return JSON or some other data format that needs to be parsed by the client. For example, I might want to return `{"code": 404}` as my body, rather than the 404 HTML that txroutes had baked in.

I created a `_render_404` method that subclasses can override to customize their 404 behavior.