How to get the app.locals object in express routing?

how do I get the app.locals object in express routing?
as follows,

router.get("/user/logout", (req, res) => {                
    delete req.session.user
    delete app.locals.user
    res.redirect("/")           
})

will report an error: there is no app.

Jan.21,2022

http://www.expressjs.com.cn/4.


req.app.get("")

get the properties mounted to app

in this way
Menu