My Flask application is deployed at a BASE_URL so that links to endpoints look like:
http://my_server/BASE_URL/endpoint/...
All URLs for Flask endpoints need to start with that BASE_URL. I find that links generated on the server side using {{ url_for(endpoint) }} work correctly, but links generated in Javascript on the client using Flask.url_for(endpoint) come out as
http://my_server/endpoint/...
with the application BASE_URL portion missing.
When viewed in a debugger both the flask server-side code and the jsglue client code seem to produce the same thing: "/endpoint/...", but the final URLs come out differently.
This may be user error, in which case I'd really appreciate some advice about how to solve it, or it may be a problem with URLs produced by jsglue.
My Flask application is deployed at a BASE_URL so that links to endpoints look like: http://my_server/BASE_URL/endpoint/... All URLs for Flask endpoints need to start with that BASE_URL. I find that links generated on the server side using {{ url_for(endpoint) }} work correctly, but links generated in Javascript on the client using Flask.url_for(endpoint) come out as http://my_server/endpoint/... with the application BASE_URL portion missing.
When viewed in a debugger both the flask server-side code and the jsglue client code seem to produce the same thing: "/endpoint/...", but the final URLs come out differently.
This may be user error, in which case I'd really appreciate some advice about how to solve it, or it may be a problem with URLs produced by jsglue.