DEV Community

Cover image for Single Page Application Routing Using Hash or URL

Single Page Application Routing Using Hash or URL

The Dev Drawer on March 26, 2022

One of the most asked code questions during a front-end interview is "Can you create a single page application with routes, without a framework?" I...
Collapse
 
romaopedro199 profile image
Pedro Romão

Man, this is amazing

Collapse
 
thedevdrawer profile image
The Dev Drawer

Wow, you are quick. I am glad you like it. You can see the entire video on my YouTube channel: youtube.com/c/devdrawer

Collapse
 
ffalconet profile image
ffalconet • Edited

Hi, very useful. Thanks for that.
I am trying to do the same. How can we do to make the links 127.0.0.1:1313/contact or 127.0.0.1:1313/about or with # to be usable.
If you want to share only the link about, the user will click on it and will receive http 404 not found . How can we add to avoid that ?
Thanks

Collapse
 
wisniewski94 profile image
Wiktor Wiśniewski

Nice! Recently I have wrote article about the same thing! wiktorwisniewski.dev/blog/how-to-c...

Collapse
 
jerryi profile image
Kirill Vasin
  1. It is still valid. Thanks for using vanilla JS