Node.js Parse URL

Write a program in node.js to parse the given url.


Whenever a request is made to an HTTP server the request object will contain url property, identifying the targeted resource. This is accessible via request.url. Node's URL module is used to decompose a typical URL string into its constituent parts. Consider the following figure:


Output of the above code

nodejs parse url

Read more articles

General Knowledge

Learn Popular Language