1.0.3 • Published 8 years ago

koa-mobile-agent v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

koa-mobile-agent

A middleware for koa to map the mobile route with user-agent.

Installation

$ npm install koa-mobile-agent

Example

const agent = require('koa-mobile-agent');
const koa = require('koa');
const app = koa();

app.use(agent({
    status: 301,  //default
    routes: [{
        path: '/',
        target: 'http://m.example.com/'
    }, {
        path: '/list/',
        target: 'http://m.example.com/list/'
    }]
}));

License

MIT

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago