Socket
Book a DemoInstallSign in
Socket

connect-force-domain

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-force-domain

Force all visitors onto a single domain

Source
npmnpm
Version
0.0.3
Version published
Weekly downloads
2
-50%
Maintainers
1
Weekly downloads
 
Created
Source

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);

Keywords

no-www

FAQs

Package last updated on 17 Nov 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts