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 Practice Importing and Exporting Modules in Node.js!
You have completed Practice Importing and Exporting Modules in Node.js!
Preview
This video covers one solution to the importing and exporting modules challenge.
Resources
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
error handlers and helper functions
into the respective modules.
0:00
Then you had to import and use the route
and error handlers in app.js and
0:03
use the helpers in a routes.js file.
0:08
Now, I'll show you my solution,
which you can compare to what you wrote.
0:10
You can also reference all my code
when you download the project files.
0:13
All right, let's start with the routes.
0:17
I created a file named routes.js.
0:18
And in routes.js, I imported express and
0:22
setup express.Router up top then
moved the two get method routes for
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