In my node.js project I have a server.js and a folder "views" that has a file called index.html, so right now when someone goes to example.com (or example.com/index.html) they go to index.js, well I'm trying to secure it so that only via specific links access is granted, for example
example.com -> takes you to access_denied.html
and
example.com/client={code-that-i-assign} example example.com/client=th9wdn298n3d2
I tried doing it with URLparams but I couldn't, can someone help me with a solution to this problem?
function api() {
const apikey = "";
const searchselect = window.location.search;
const urlsearchparams = URLSearchParams(searchselect);
urlsearchparams.has(apikey).then(return true);
}