0.0.1 • Published 9 years ago

mobile-redirect v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

mobile-redirect

A simple Express middleware to redirect the mobile user.

mobile-redirect will detect if the request is a mobile device. If so, it will redirect the user to your desired path.

##Install

npm install --save mobile-redirect

##Usage

var mdirect = require('mobile-redirect');

app.use(mdirect());

###API

mdirect(opt)

  • Returns the middleware function that redirects the user to a path.
  • Accepts an option object to change the default path.

###Options

//default
{
    redirectPath: '/mobile'
}

###Test

npm test

Note: Most tests are covered by is-mobile. Also, mobile-redirect will cover most mobile devices where is-mobile fails.