@pi0/req-url
Easily grab full URL from a request (http.IncomingMessage) object
Last updated a year ago by pi0 .
MIT · Original npm · Tarball · package.json
$ cnpm install @pi0/req-url 
SYNC missed versions from official npm registry.

req-url

Easily grab full URL from a request (http.IncomingMessage) object.

Features

  • Browser fall-back
  • Detect HTTPS requests using is-https
  • Super Small (282B min-gzip)

Usage

ESM import:

import reqURL from 'req-url'

CommonJS import:

const reqURL = require('req-url')

Default export signuture is:

reqURL(request?: http.IncomingMessage): String

Example:

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

License

MIT

Current Tags

  • 1.0.0                                ...           latest (a year ago)

1 Versions

  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |