server-url
v1.1.0
Published
Retrieve the url a server is listening on
Downloads
7
Maintainers
Readme
server-url
Retrieve the url a server is listening on.
Installation
npm install server-url
Usage
var serverUrl = require('server-url')
var http = require('http')
var server = http.createServer()
var url = serverUrl(http.listen())
// => `http://0.0.0.0.0:1337`
Why?
Retrieving a server url is a bit verbose. This makes it easier.