Answers for "url.parse deprecated alternative"

2

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, "");
Posted by: Guest on June-02-2021

Code answers related to "url.parse deprecated alternative"

Browse Popular Code Answers by Language