Python - Flask Default Route possible?

前端 未结 3 1211
情深已故
情深已故 2020-12-05 04:44

In Cherrypy it\'s possible to do this:

@cherrypy.expose
def default(self, url, *suburl, **kwarg):
    pass

Is there a flask equivalent?

3条回答
  •  感动是毒
    2020-12-05 05:04

    @app.errorhandler(404)
    def handle_404(e):
        # handle all other routes here
        return 'Not Found, but we HANDLED IT
    

提交回复
热议问题