标签:case else bsp class list bar dev too head
var express = require(‘express‘);
var app = express()
app.get(‘/‘, function(req, res){
var deviceAgent = req.headers["user-agent"].toLowerCase();
var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/);
if(agentID){
console.log(111,‘手机、pid‘)
}else{
console.log(222,‘pc‘)
}
})
app.listen(3000)
标签:case else bsp class list bar dev too head
原文地址:http://www.cnblogs.com/zhangshuda/p/7640347.html