Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I know the language, and the request software (browser) in Express?

When they make a request to my creator server in Express, and I try to know the language, and the browser software, with req.language and `req.software“ it gives me undefined

my current code is:

app.get('/api/whoami',  (req, res, next)=> {

    let json = {"ipaddress": req.ip, "language": req.language, "software":  req.software}

    res.json(json)

    next()
})

to see the complete code in more detail visit https://replit.com/@Michael-Liendo/boilerplate-project-headerparser

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

req.headers["user-agent"]        // browser info
req.headers["accept-language"]   // user's browser language
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading