GithubHelp home page GithubHelp logo

halogenandtoast / node-heroku-ssl-redirect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paulomcnally/node-heroku-ssl-redirect

0.0 2.0 0.0 7 KB

Redirect users to the SSL version of your app. For ExpressJS running on Heroku

License: MIT License

JavaScript 100.00%

node-heroku-ssl-redirect's Introduction

node-heroku-ssl-redirect

Redirect users to the SSL version of your app. For ExpressJS running on Heroku

Installation

npm install heroku-ssl-redirect

Usage

var sslRedirect = require('heroku-ssl-redirect');
var express = require('express');
var app = express();

// enable ssl redirect
app.use(sslRedirect());

app.get('/', function(req, res){
  res.send('hello world');
});

app.listen(3000);

Environments

Default environment is production, if you need enable redirect with other environment you need send an array argument.

app.use(sslRedirect([
  'other'
  'development',
  'production'
  ]));

HTTP status code

By default a 302 will be used to redirect. A 301 can be configured with the second argument.

app.use(sslRedirect(['production'], 301));

ExpressJS 3.x (issue #1)

npm install git://github.com/paulomcnally/node-heroku-ssl-redirect.git#express3x --save

node-heroku-ssl-redirect's People

Contributors

dmnd avatar malcolmdwyer avatar paulomcnally avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.