connect-browser-filter

0.0.1 • Public • Published

Connect Browser-filter Middleware

This middleware is used to check the User-Agent, and redirect the incompatible UA to another URL.

Usage

var connect = require('connect')
  , http = require('http');

var app = connect()
  .use(connect.favicon())
  .use(require('connect-browser-filter')(
    //The filter and redirect map.
    //Now only support 'ieX' series.
    {
      '/legacyIE.html': ['ie6', 'ie7']
    },
    {
      //Ignore files list.(Optional)
      ignores: ['/images/logo.png', '/images/sprite.png']
    }
  ))
  .use(connect.static('public'))
  .use(function(req, res){
    res.end('Hello from Connect!\n');
  });

http.createServer(app).listen(3000);

License

View the LICENSE file.

Readme

Keywords

none

Package Sidebar

Install

npm i connect-browser-filter

Weekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • ruisin