I have a code editor (using HTML/CSS/JS only) called https://quarkedit.ga
I'm trying to add a new feature, sort of like how https://scratchpad.io does.
The feature is this: Whenever a user comes to https://quarkedit.ga redirect to a randomly generated code plus the domain (like https://quarkedit.ga/green-panda-2066) and the next time the user visits the page reload that code.
My design for this is as follows:
When user comes to quarkedit.ga, get the pathname. If pathname exists in database (using Firebase for database), display code, else redirect back to quarkedit.ga and generate a new random code and go there.
When a user leaves quarkedit.ga, get the code and save it in the database with the pathname as key.
So I tried to implement this, and I ran into a problem. https://quarkedit.ga/blahblah gives me a 404, because there is no html file there.
So here is what I need help with: How do I make that step work, like make it so that blahblah goes back to the quarkedit.ga but keep blahblah in the URL so I can still access it?
I would like to use only Html, css, or js in this.