title: How to deploy an angular app so that it works under any path?
body: <p>this is probably a newbie question, but I couldn't find any answers to it here or on angular documentation.
  Let's say I have a simple Angular application (the <a href="https://angular.io/tutorial/toh-pt1" rel="noreferrer">hero editor</a> from the angular.io tutorial for instance) that I want to distribute <strong>without yet knowing</strong> under which path it will run on my webserver. It could be under:</p>
  <ul>
  <li><a href="http://host.domain/foo/myapp/" rel="noreferrer">http://host.domain/foo/myapp/</a></li>
  <li><a href="http://host.domain/foo/bar/myapp/" rel="noreferrer">http://host.domain/foo/bar/myapp/</a></li>
  <li>etc... you get the idea</li>
  </ul>
  <p>Put differently, I'd need the generated sources (the index.html and its angular associated js files) to be fully working under <strong>any</strong> path (I guess that's why relative path are for...) currently my generated sources only work if I put them at the root dir my server, because of the</p>
  <pre><code>&lt;base href=&quot;/&quot;&gt; 
  </code></pre>
  <p>npm deploy has generated in the index.html probably...I tried naively to change it to</p>
  <pre><code>&lt;base href=&quot;./&quot;&gt;
  </code></pre>
  <p>in order that my browser interpret the path of the included JS files as relative to the index.html. With this, my browser correcly finds the JS files, however the angular app is no longer working (blank  page...).<br />
  Any idea of what should  be the proper &quot;angular-way&quot; of doing that?
  Thanks for your help in advance!</p>