What I want is Identify the user then redirect from backend to some url.
app.get('/someurl', function (req, res, next) {
if(android OS){
res.redirect("https://playstore")
}else{
res.redirect("https://appstore")
}
})
You could use the ua-parser-js package.
npm install ua-parser-js
From there you can follow the docs.
Or do the following:
const parser = require("ua-parser-js")
app.get('/someurl', function (req, res, next) {
if(parser(req.headers["user-agent"]).getOS().name === "Android[-x86]") {
res.redirect("https://playstore")
} else{
res.redirect("https://appstore")
}
})