Skip to content

Route using a Model

Karen Coombs edited this page May 31, 2018 · 1 revision

Displaying the User information

In order to display the actual bibliographic data we have to retrieve it from the API and pass it to our view.

  1. Open server.js
  2. Find HTTP GET myaccount route
app.get('/myaccount', (req, res) => {
  1. Remove line
res.render('display-user'); 
  1. 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
    })

Clone this wiki locally