express-public-url

1.0.3 • Public • Published

express-public-url

This little module adds req.urlBase and req.publicUrl to your express routes to make it easy to get the incoming request URL regardless of where you app us running - behind a proxy, load-balancer etc.

Installation

npm install --save express-public-url

Usage

var express = require('express');
var app = express();
 
// require module
var expressPublicUrl = require('express-public-url');
 
// add middleware to get the public Url from either the http proxy headers or current request host
app.use(expressPublicUrl());

Star the repo

If you find this useful please star the repo, it helps us prioritize which open source bugs to fix 🙌

History

For change-log, check releases.

License

Licensed under MIT License © John Doherty

/express-public-url/

    Package Sidebar

    Install

    npm i express-public-url

    Weekly Downloads

    280

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    4.13 kB

    Total Files

    5

    Last publish

    Collaborators

    • john-doherty