incoming-url
v1.0.0
Published
Gets the incoming url for a request
Downloads
253
Maintainers
Readme
incoming-url
Gets the incoming url for a request
usage
var incomingUrl = require('incoming-url');
var incomming = incomingUrl(request);
console.log(incomming); // https://www.foo.com/bar?things=stuff
example
var http = require('http'),
server = http.createServer(),
port = 8080,
incomingUrl = require('incoming-url');
server.on('request', function(request, response){
var incomming = incomingUrl(request);
console.log(incomming);
response.end();
});
server.listen(port, function(error){
if(error){
console.log(error);
return process.exit(-1);
}
console.log('Listening on port: ' + port);
});