Following is a pug
snippet. I need to dynamically populate the user
in chatConfig
object.
script.
var chatConfig = {
user : 'foo',
pass : 'bar',
}
From my express , I am rendering as
resp.render('user/index', {username:req.user});
How do I pass the value of req.user
to user
key inside script.
?