SPA Router using vanilla js Running project locally npm install node server.js visit localhost:3000 Prerequisite History.pushState() Window: popstate event Window: DOMContentLoaded event For a detailed explanation and implementation of the router, you can read the blog here.