Also called SPA. A single page app is entirely based on a single index.html file. All the routes are not distinct HTML files, but created dynamically using JavaScript.


Example

Here is how routing in such an app might work:

  • When the user clicks on a link to another page of the domain, e. g. “/about”
  • Instead of an HTTP request going out to the server, requesting the /about HTML, JavaScript intervenes
  • The JS code changes the path in the browser
  • The JS code exchanges the HTML contents of the page

This way, everything looks and feels like navigating to another page in the classical sense - but still, everything was done on the single HTML file the server initially sent to the client.

This term is a little confusing, as SPAs do not necessarily only have one page / route. A SPA can neverthless have the pages /, /about, /login etc. - yet, there is no individual representation for each of them.

Opposed to Multi page app


Pros and cons

  • Faster navigation between pages as no server requests are necessary