full-url
v1.0.0
Published
A function that returns the full URL of a request, including the scheme and host.
Downloads
713
Readme
full-url
full-url is a function that returns the full URL of a request, including the scheme and host.
Install
npm install full-url
Example
node
var server = require('http').createServer
var url = require('full-url')
server(function(request, response) {
url(request)
// => http://localhost:1234/[wherever]
response.end()
}).listen(1234)
browser(ify)
var url = require('full-url')
var path = '[wherever]' || '/path/to/resource'
url(path)
// => http://whenev.er/[wherever]