Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

requrl

2.0.1 • Public • Published

requrl

npm dt bundlephobia

Grab full URL from request.

Features

  • 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

Usage

import getURL from 'requrl'
// OR
const getURL = require('requrl')

Function signuture is:

function getURL(req?: IncomingMessage): string

Example:

const url = getURL(req)
// http://localhost:3000/aaf/dfdf
// https://www.foo.com/foo/bar

License

MIT

Keywords

none

Install

npm i requrl

DownloadsWeekly Downloads

3,609

Version

2.0.1

License

MIT

Unpacked Size

4.43 kB

Total Files

4

Last publish

Collaborators

  • avatar