-
Notifications
You must be signed in to change notification settings - Fork 3
Route using a Model
Karen Coombs edited this page May 31, 2018
·
1 revision
In order to display the actual bibliographic data we have to retrieve it from the API and pass it to our view.
- Open server.js
- Find HTTP GET myaccount route
app.get('/myaccount', (req, res) => {
- Remove line
res.render('display-user');
- Use the User class to find the user information
User.find(context.accessToken.getAccessTokenString())
.then(user => {
res.render('display-user', {user: user});
})
.catch (error => {
// catch the error
})