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 Using Sequelize ORM With Express !
You have completed Using Sequelize ORM With Express !
Preview
In this video, you will start reading data from the database. You'll display all the articles on the main page, as well as an individual article.
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
then display an individual article when
a user clicks an article's Read More link.
0:00
First, we'll find individual articles.
0:02
In the routes articles.js file,
0:05
I'll scroll to where I've defined
the GET route for an individual article.
0:07
This route renders
the articles show view and
0:11
displays an article based on
the id parameter in the URL path.
0:14
Currently, it sets the article local
variables for the view to an empty object.
0:19
Within the handler function,
0:23
we'll use Sequelize's findByPk method to
find an article by its primary key or id.
0:24
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