Grab full URL from request
npm install requrl


Grab full URL from request.
- Universal (browser and node.js) support
- Detect HTTPS requests using is-https
- Support x-forwarded-proto and x-forwarded-host
- Always encode URI
- Super Small
``js`
import getURL from 'requrl'
// OR
const getURL = require('requrl')
Function signuture is:
`ts`
function getURL(req?: IncomingMessage, includePath?: boolean): string
Example:
`js``
const url = getURL(req)
// http://localhost:3000
// https://www.foo.com
MIT