Url module is the core modules of node.js, which is used to parse the URL and its other properties.
The URL module splits up a web address into readable parts. To include the URL module, use the require() method:
an HTTP server will require information from the request URL to accurately process a request. This request URL is located on the url property contained within the req object itself.
var url = require('url');
Parse an address with the url.parse() method, and it will return a URL object with each part of the address as properties:
Example
File Name : example.js
var url = require('url');
var adr = 'http://localhost:8080/default.htm?year=2022&month=April';
var q = url.parse(adr, true);