1.0.3 • Published 8 years ago
koa-mobile-agent v1.0.3
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