OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Is HashLocationStrategy really required for Angular apps hosted in Azure storage account?

  • Thread starter Thread starter Danie
  • Start date Start date
D

Danie

Guest
I have always learned that you need a server to use Angular PathLocationStrategy for the routing to work. Without a server, for example when hosting as static website in Azure storage account, you need to use HashLocationStrategy.

I gave it a try to get it working without a server, and to my surprise everything seems to be working. Am I missing something?

Setup:

  • Angular 14 application using PathLocationStrategy.
  • Hosted in Azure storage account, $web blob container, static website enabled.
  • Azure CDN with endpoint of origin type storage static website.
  • The endpoint Rule Engine has a rule that rewrites all to destination /index.html.
<p>I have always learned that you need a server to use Angular PathLocationStrategy for the routing to work. Without a server, for example when hosting as static website in Azure storage account, you need to use HashLocationStrategy.</p>
<p>I gave it a try to get it working without a server, and to my surprise everything seems to be working. Am I missing something?</p>
<p><strong>Setup:</strong></p>
<ul>
<li>Angular 14 application using PathLocationStrategy.</li>
<li>Hosted in Azure storage account, $web blob container, static website enabled.</li>
<li>Azure CDN with endpoint of origin type storage static website.</li>
<li>The endpoint Rule Engine has a rule that rewrites all to destination /index.html.</li>
</ul>
Continue reading...
 
Top