npm.io
1.0.1 • Published 8 years ago

sails-hook-httpsredirect-aws

Licence
MIT
Version
1.0.1
Deps
0
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

sails-hook-httpsredirect-aws

Forked from: https://github.com/greguz/node-sails-hook-httpsredirect

This sails hook will start an HTTP server that will redirect all received requests to the HTTPS server lifted from sails that includes validation for AWS Elastic Load Balancer and fixes the bug: https://github.com/greguz/node-sails-hook-httpsredirect/issues/1.

If the HTTPS server is not configured, this module will not start any server.

Installation

NPM

Run npm install --save sails-hook-httpsredirect-aws

Usage

Just install this module and lift your server.

Configuration

Parameters
Parameter Type Default Description
disabled {Boolean} false if true, the HTTP server will not start
hostname {String} '0.0.0.0' HTTP server accepted hostname, default all
port {Number} 80 or 1337 HTTP server port: by default port 80 on production and 1337 on other environments
Runtime

You can access the configuration from sails.config.httpsredirect var.

File

You can customize the settings by creating config/httpsredirect.js file.

/**
 * HTTP to HTTPS hook configuration
 */

module.exports.httpsredirect = {

  // listen only localhost requests
  hostname: '127.0.0.1',

  // from port 1234
  port: 1234

};

Keywords