Connect module for node.js - force all visitors onto a single domain
Pull request Compare This branch is 27 commits behind shapeshed:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

Connect Force Domain

Build Status

Inspired by Rack::ForceDomain it directs all traffic to a single domain with a 301 redirect.

This is useful where you are hosting your node site with Joyent, Nodester or Bejes.us and want to ensure all visitors are on the same domain.

Installation

via npm

npm install connect-force-domain

Usage

For connect

var connect = require('connect'),
    force_domain = require('connect-force-domain');

connect.createServer(force_domain('shapeshed.com')).listen(3000);

For express

var express = require('express'),
    force_domain = require('connect-force-domain');

express.createServer(force_domain('shapeshed.com')).listen(3000);