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