The url.hostname is an inbuilt application programming interface of class URL within the url module which is used to get and set the hostname portion of the URL. The url.hostname does not include the port number.
It associates by single value url which is an object created by URL constructor.
Before Change gfg.org After Change geeksforgeeks.org
- Node.js | NPM (Node Package Manager)
- PHP vs. Node.js
- Node js | OS
- Why Node.js ?
- Node | URL.host API
- Node | URL.hostname API
- Node | URL.hash API
- Node.js Events
- Node | URL.fileURLToPath API
- Node | URLSearchParams.set()
- HTTPS in Node
- Node | URLSearchParams.has()
- Node | URL.pathToFileURL API
- Routing in Node.js
- Promises in Node.js
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : ManojVarmaPenmatsa