the URL module splits the url into readable parts for
const urladdress = 'http://localhost:8080/default.htm?year=2017&month=february'; const url = require('url'); let q = url.parse(urladdress,true); console.log(q);
Output:
Url { protocol: 'http:', slashes: true, auth: null, host: 'localhost:8080', port: '8080', hostname: 'localhost', hash: null, search: '?year=2017&month=february', query: [Object: null prototype] { year: '2017', month: 'february' }, pathname: '/default.htm', path: '/default.htm?year=2017&month=february', href: 'http://localhost:8080/default.htm?year=2017&month=february' }
Quick Links
Legal Stuff