<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SPA on The Blog of Boban Acimovic</title><link>https://acim.net/tags/spa/</link><description>Recent content in SPA on The Blog of Boban Acimovic</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>The Blog of Boban Acimovic &amp;copy; 2026</copyright><lastBuildDate>Sun, 03 May 2020 00:00:00 +0000</lastBuildDate><atom:link href="https://acim.net/tags/spa/index.xml" rel="self" type="application/rss+xml"/><item><title>Serving Single-Page Applications in Go</title><link>https://acim.net/blog/serving-spa/</link><pubDate>Sun, 03 May 2020 00:00:00 +0000</pubDate><guid>https://acim.net/blog/serving-spa/</guid><description>&lt;p&gt;Someone may ask what is so special about serving single-page applications? Well, if you use hash (#) based URL&amp;rsquo;s like &lt;a href="https://yourdomain.com/#/yourroute" target="_blank" rel="noopener"&gt;&lt;em&gt;https://yourdomain.com/#/yourroute&lt;/em&gt;&lt;/a&gt;
, there is no problem because browser recognize that this is a default page with some parameters and doesn&amp;rsquo;t make another request to the server. However, if you want to use non-hash based routes, there is a problem if you try to refresh a non-default route. In this case browser&amp;rsquo;s default action is to load such URL from the server and there is no such document on the server. For example, if you load your SPA at URL &lt;a href="https://yourcomain.com" target="_blank" rel="noopener"&gt;&lt;em&gt;https://yourdomain.com&lt;/em&gt;&lt;/a&gt;
 and then you click on another route, you will see in your browser&amp;rsquo;s URL field something like &lt;a href="https://yourdomain.com/yourroute" target="_blank" rel="noopener"&gt;&lt;em&gt;https://yourdomain.com/yourroute&lt;/em&gt;&lt;/a&gt;
. That works fine unless you try to reload the page. In that case browser doesn&amp;rsquo;t know this is actually already loaded SPA, but it actually tries to fetch &lt;em&gt;/yourroute&lt;/em&gt; URI from server. As there is no such URI on the server, you will usually get the famous 404 error and your application breaks.&lt;/p&gt;</description></item></channel></rss>