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

express-public-url

1.0.0 • Public • Published

express-public-url

Linked In Twitter Follow

Parses HTTP headers to generate the correct public url for the application.

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());

From within your routes you can now access the requested base URL via req.urlBase, regardless of where port/server your internal node service sits on.

History

For change-log, check releases.

License

Licensed under MIT License © John Doherty

Install

npm i express-public-url

DownloadsWeekly Downloads

8

Version

1.0.0

License

MIT

Unpacked Size

4.09 kB

Total Files

5

Last publish

Collaborators

  • avatar