In Cherrypy it\'s possible to do this:
@cherrypy.expose
def default(self, url, *suburl, **kwarg):
pass
Is there a flask equivalent?
If you single page application has nested routes (e.g. www.myapp.com/tabs/tab1 - typical in Ionic/Angular routing), you can extend the same logic like this:
@app.route('/', defaults={'path1': '', 'path2': ''})
@app.route('/', defaults={'path2': ''})
@app.route('//')
def catch_all(path1, path2):
return app.send_static_file('index.html')