server-side browser detection? node.js

前端 未结 15 1128
不知归路
不知归路 2020-12-07 09:29

Most implementations i\'ve seen are for browser detection on the client side. I was just wondering if it was possible to do browser detection before sending any resources to

15条回答
  •  没有蜡笔的小新
    2020-12-07 10:01

    if your using express you can easily check the ua with something like this:

    app.get('/ua', function(req, res){
        res.send('user ' + req.headers['user-agent']);
    });
    

提交回复
热议问题