python - Browser Navigation with Flask and ngRoute -
i have single page angularjs app uses ngroute python flask backend. problem when navigate url through app, works fine -- if try refresh page, or navigate route directly, 404 error.
for example, if navigate page (localhost:5000/help) through app, get:
get /partials/help.html http/1.1 200-
but if open new tab , enter in url of localhost:5000/help, get:
get http/1.1 - 404
i think problem in directory structure (see below) , in how serving initial route through flask. here relevant part of main.py:
app = flask(__name__, static_url_path="") api = api(app) @app.route('/') def index(): return app.send_static_file('index.html')
here relevant parts of file structure:
project_path |-main.py |-static/ |-index.html |-partials/ #contains html templates routed views |-js/ |-app.js #contains ngroute logic app |-controllers/ |-libs/
if helpful see routes in app.js, let me know , include them.
any on appreciated, driving me absolutely crazy trying figure out
Comments
Post a Comment