mobile-redirect

0.0.1 • Public • Published

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.

Package Sidebar

Install

npm i mobile-redirect

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • iwatakeshi