Search code examples
javascriptpythonweb2pyaureliajspm

How can I load my Aurelia app from an index.html which is not located in the same folder as the rest of the application?


How can I load my app from an index.html which is not located in the same folder as the rest of the application?

I’m currently using jspm (which I’m new to). I’m trying to integrate Aurelia with web2py (Python web framework).

My index.html in accessible via

http://websiteaddress.com/myapp/default/index.html

and may later be accessible via

http://websiteaddress.com/myapp/index.html

but the code of my Aurelia app is accessible from

http://websiteaddress.com/myapp/static/aurelia_app/

On the disk the index.html file is at

/web2py/applications/myapp/views/default/index.html

and the Aurelia app folder is at

/web2py/applications/myapp/static/aurelia_app

Solution

  • You need to use the web2py pattern router, something like this in the router definition should work:

    routes_in = (
      ('/appname/default/index', '/appname/static/aurelia_app/index.html'),
      ('/appname/default/jspm_packages/$anything', '/appname/static/aurelia_app/jspm_packages/$anything'),
    )