]> git.ardis.lu - minimal-routing/summary
 
descriptionDemo website for the minimum JavaScript required to implement client-side routing.
last changeTue, 23 Jun 2026 06:04:11 +0000 (23:04 -0700)
readme

minimal-routing

Demo website for the minimum JavaScript required to implement client-side routing using the Navigation API (new as of January 2026).

Code repository mirrors: GitHub, Codeberg, git.ardis.lu

Web server configuration

This demo website assumes that the web server has been configured to serve index.html on all routes EXCEPT for the special path: /errors/NotFound. For /errors/NotFound, the web server must respond with a 404 Not Found error and the file /errors/404.html.

Note: this file path is intentionally nested in a folder because some static site hosts (like Cloudflare Pages) use a top-level 404.html page as a flag to override the desired behavior of serving index.html on all other routes.

The desired behavior can be replicated locally using the npm package local-web-server:

ws --spa index.html --rewrite '/errors/(.*) -> /errors/404.html'
shortlog
2026-06-23 Ardis LuFix infinite navigation loop on 404 main
2026-06-23 Ardis LuInclude forward slash in route name
2026-03-15 Ardis LuRefactor to use Navigation API
2026-03-11 Ardis LuAdd code repository mirrors
2026-03-10 Ardis LuAdd MIT license
2025-01-26 Ardis LuSimplify font stacks
2025-01-25 Ardis LuDelete unnecessary <section> tag
2024-11-28 Ardis LuUse one global click handler instead of individual...
2024-11-28 Ardis LuDelete window references
2024-11-28 Ardis LuSimplify pages element
2023-08-11 Ardis LuAdd note and demo about scroll reset on navigation
2023-03-23 Ardis LuMove nav to top on small screens
2023-03-23 Ardis LuCenter the nav buttons
2023-03-05 Enceladusadded index.html to default route
2023-02-24 Ardis LuAdd point about status bar link preview
2023-02-05 Ardis LuUse precise word
...
heads
3 months ago main
This page took 0.055995 seconds and 7 git commands to generate.