Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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, "");
 
PREVIOUS NEXT
Tagged: #deprecated
ADD COMMENT
Topic
Name
6+8 =