stewartpark / Flask-JSGlue

Flask-JSGlue helps hook up your Flask application nicely with the front end.
80 stars 39 forks source link

Does not work if app is running in subdirectory #2

Closed fleshgolem closed 9 years ago

fleshgolem commented 9 years ago

Let's say I have a flask app running and the root URL is http://www.example.com/app

JSGlue.include() will still point to http://www.example.com/jsglue.js and thus will not work

fleshgolem commented 9 years ago

Also the generated paths will be absolute as well and unaccessible

stewartpark commented 9 years ago

I appreciate your input on this! I've been asked this several times, so I'll make sure this issue can be resolved in the next release.

While the library lacks the interface of changing its endpoint, there's a hack you can do for now. Try this code before you create a JSGlue object:

import flask_jsglue
flask_jsglue.JSGLUE_JS_PATH = '/foo/bar.js'

Since the implementation itself isn't dependent on the endpoint, so this might work for now. Of course, there will be a nicer way of doing this in the next release. Until then, I'll keep this issue open for now.