I writing an app in Angular + Flask hosted on heroku. I've been looking to use html5mode to use myapp.co/register
for oauth. The problem with html5mode is that server needs to rewrite url if someone refreshes the page or clicks the link that is not root. I tried to use this snippet to catch them all, but it doesn't work.
@app.route("/", defaults={"path": ""})
@app.route("/<path:path>")
def index(path):
print path
return make_response(open(app.static_folder + "index.html").read())
output 404
* Restarting with reloader
127.0.0.1 - - [23/Jan/2014 13:41:48] "GET /ass HTTP/1.1" 404 -
App got root that servers index.html and /api/v1/ that is RESTful api