Answers for "node js url.parse deprecated"

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 "node js url.parse deprecated"

Browse Popular Code Answers by Language