URL.
// Get the url and parse
const myUrl = new URL(req.url, "http://localhost:3000/");
// Get url path
const path = myUrl.pathname;
const trimmedPath = path.replace(/^\/+|\/+$/g, "");
Encouraging Eel