I'm clearly not getting some core Node concept. After validating a user from the database, the database returns an object("pass_to_html"). I want to render the results of that object onto a new page that is using handlebars.
My abbreviated code from login_handler.js (the server js doing the validating and pushing and pulling from the database):
function getTheeToDashboard(pass_to_html){
app.post('/dashboard',function(req,res, next){
res.redirect('/dashboard')
res.render('dashboard', {view: dashboard, trainer_name: pass_to_html.trainer_data.trainer});
})
}
from dashboard.js
router.get('/', function(req, res, next) {
res.render('dashboard')
});
from app.js:
app.use('/dashboard', dashboard);
from dashboard.hbs:
<h1> Welcome ! </h1>
I don't get any errors, but clearly the app.htmlVerb does not engage. I've tried app.get, app.put and app.post.
via edswartz
No comments:
Post a Comment