Closed beck closed 6 years ago
The docs say:
pathname is treated the same with or without the leading / (slash)
Testing the lib in a console:
> const url = require('url'); undefined > url.format({hostname: 'dougbeck.me', pathname: '/womp'}) 'dougbeck.me/womp' > url.format({hostname: 'dougbeck.me', pathname: 'womp'}) 'dougbeck.mewomp'
Is also a bug in node. Am closing because the better approach is to use WHATWG URL. rel: https://github.com/nodejs/help/issues/1176
Problem
The docs say:
Example
Testing the lib in a console: