Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Build a Simple Dynamic Site with Node.js!
You have completed Build a Simple Dynamic Site with Node.js!
Preview
We're now going to get user data from the API and print it out on the user route.
Update
If you run into any issues getting profile information back you may have to change the endpoint for the user profiles from
"https://teamtreehouse.com/" + username + ".json"
to
"https://teamtreehouse.com/profiles/" + username + ".json"
Node.js APIs Used
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
on getting the live student data and
outputting that into our user route.
0:00
We're here in the router.js file.
0:00
And this is where we would want to do all
the username
0:02
profile information retrieval part of our
application.
0:07
So let's take a look at the example and
let's just copy and
0:12
paste some of this code here.
0:16
So let's grab the required statement at
the top and
0:17
the student profile variable and go to our
router.
0:21
And at the top, just have the profile
required.
0:26
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up