In JavaScript, how do you generate a page on your website

So basically, I need to know how to make a JavaScript script that generates another part of the website. Like when you post something on YouTube, it makes a custom link to the video as in I want to know how to generate that 23432234 page thing. I am doing this on an HTML website on github.

seems like a database id, you can use nodeJS for this. This allows you to build a back-end of a website, where you can store uploaded videos, and then load them based on ID

the different videos are the same webpage, but loaded with different video, which it pulls from a database at the back-end of a website. This shouldn’t be done in front-end only

Well your primary key should be an auto incrementing ID, nothing special there. Then generate a random token for each video that you’ll store. Retrieve the token and append it to the page url (like youtube does