Connect Force Domain
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);