当前位置: 动力学知识库 > 问答 > 编程问答 >

node.js - how to use response render for a url in nodejs

问题描述:

U am using passport Facebook to authenticate the application on success callback how to redirect to the desired URL

router.get('/auth/facebook/callback',

passport.authenticate('facebook', {

successRedirect : '/success',

failureRedirect: '/'

}),

on success i am routing to /success

router.get('/success', function(req, res){

res.render({ url:"http://localhost:8000/#/"});

});

if i use the above code i am getting the error has

Failed to lookup view "[object Object]" in views directory "D:\project1\bookish\AdminBookPublisherRefractor/app/views"

I actually don't know how to redirect to a url any suggestion

网友答案:

you can simple render your view with calling path..

res.render('pages/about');
分享给朋友:
您可能感兴趣的文章:
随机阅读: