How does express determine that the device type returns to the home page under different paths when the user accesses the primary domain name?

how does express determine the device type to return to the home page under different paths when the user accesses the primary domain name?
if you visit mobile phone and PC, visit www. respectively. The domain name .com returns a different index home page

Mar.07,2021

on node, you can use req.headers ['user-agent'] to match whether it is accessed on PC, for example:

router.get('/', function(req, res, next) {
  var agent = req.headers['user-agent'];
  var tpl = /Android|webOS|iPhone|iPod|BlackBerry/i.test(agent)? 'index' : 'index2';
  //index.htmlindex2.html
  res.render(tpl);
});
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3819e-2c0ee.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3819e-2c0ee.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?