How to host multiple versions of a SPA

Viewed 48

I would like to host multiple versions of a SPA on the same site. I would like to use initial load paths like this:

http://host/myapp/1.0.1
http://host/myapp/1.0.2

However, if my html uses relative paths like "css/myapp.css", then these resolve to:

http://host/myapp/css/myapp.css

I know why this is, and I know if I use trailing "/" on the initial page loads it will work correctly, but obviously it would nice to not have to tell people to use the "/" on the end.

I suppose I could have the app adjust the base path on load, but that complicates the app somewhat. I am using vue and the solution would need to work at runtime, not compile time since i don't know all the subfolders the immutable app will be loaded from.

Is there a cleaner way to support multiple version-folders this way and have relative paths work properly?

0 Answers
Related