polymerpolymer-1.0

Issue with deployment polymer application to subdirectory


I have a problem trying to deploy a polymer application to the server. I created the Application using Polymer-Cli. Also the routing is done using <app-route> element. The server is IIS Server, and the issue comes because they want to deploy the application as a directory:

rapidsites.com/msa/... I uploaded other websites to the root directory and I've never faced problems but in that case I had severals:

  1. The application doesn't find my-app.html. (this one I solved by removing "/" from the begining in this way: <link rel="import" href="src/my-app.html">
  2. The routing doesn't work all, the links miss the subdirectory and doesn't find anything.

This is the my-app element route:

<app-location route="{{route}}"></app-location>
<app-route
    route="{{route}}"
    pattern="/:page"
    data="{{routeData}}"
    tail="{{subroute}}">
</app-route>
<iron-pages role="main" selected="[[page]]" attr-for-selected="name">
  <my-login name="login"></my-login>
  <my-workpanel name="workpanel" route="{{subroute}}"></my-workpanel>
</iron-pages>

Solution

  • I solve this issue using the property use-hash-as-path in the app-location:

    <app-location route="{{route}}" use-hash-as-path></app-location>
    <app-route
        route="{{route}}"
        pattern="/:page"
        data="{{routeData}}"
        tail="{{subroute}}">
    </app-route>