0.1.2 • Published 11 years ago

connect-no-www v0.1.2

Weekly downloads
13
License
-
Repository
github
Last release
11 years ago

connect-no-www

Connect middleware to redirect clients from www.yourhost.com to yourhost.com

Usage:

npm install connect-no-www

nowww = require('connect-no-www');
nowww(secure); // returns middlware, true if https, false or optional otherwise

Example:

var connect = require('connect')
  , nowww = require('connect-no-www')
  , fs = require('fs')
  , options = {
      key: fs.readFileSync('ryans-key.pem'),
      cert: fs.readFileSync('ryans-cert.pem')
    };

// https
connect.createServer(options, 
  nowww(true)
).listen(443);

// http
connect.createServer(
  nowww(false)
).listen(80);
0.1.2

11 years ago

0.1.1

12 years ago

0.1.0

13 years ago