サンプルコード:
// index.pug
p #{polls}
// API エンドポイント
http://localhost:8080/api/polls
// ルート ファイル (index.js):
ここでは、どのように api に get リクエストを行い、取得した結果を api(locals) から polls 変数に渡しながら、profile.pug をレンダリングしますか?
app.route('/profile')
.get(isLoggedIn, function (req, res) {
res.render('profile', {'polls': passvaluehere});
});
});