1

I am trying to work out how to deploy an aurelia app, it runs in development with au run. but I need to deploy it into a path which is not the root of the web-site. ie at '/site' not '/'

when I deploy I get an exception from the router: ERROR [app-router] Error: Route not found: /site/

I think it may be that I need to specify a baseURL in one or more places?

but can't see how I can:

  • make it work in the development environment at /
  • make it work in the deployed environment at /[any-site-path]
  • avoid building in knowledge of '/[any-site-path]' to my development environment or bundles, as the path wont be known until someone comes to deploy the code?

i found this question but that seems to apply to an out of date version of the code.

I am using Aurelia 1.0 and building using the au-cli

Any pointers would be useful.

Community
  • 1
  • 1
wuzzy
  • 41
  • 4

1 Answers1

0

Looks like this is a bug that has been fixed in a more recent version.

I have just gone through and applied the latest versions of:

  • "aurelia-bootstrapper": "^1.0.0" -> "^2.1.1"
  • "aurelia-cli": "^0.24.0" -> "^0.26.1"
  • "aurelia-tools": "^0.2.2" -> "^1.0.0"

And i can now deploy my application to a site sub folder without specifying any url content in the code or html files!

So I can satisfy all 3 of the criteria in my question.

Note the aurelia-cli update (0.25.0) requires a change to the main.(ts/js) as mentioned in the release notes.

wuzzy
  • 41
  • 4
  • Having tried to apply this change to my 'real' app It would appear that I also have to pull jquery up. In this case I am using 3.1.1. – wuzzy Mar 10 '17 at 12:32
  • Switching to the push-state implementation requires the app to be configured with the base route in the router config options .root property. Still looking for a way to not build in this value. – wuzzy Mar 10 '17 at 14:19