http node url parse deprecated code example
Example: url.parse deprecated
// 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, "");