Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Connect Middleware to force visitors onto a single domain

tag: 0.0.1

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
README.md

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.js 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][8]

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

express.createServer(force_domain('shapeshed.com')).listen(3000);
Something went wrong with that request. Please try again.