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
The basis of our templates are the contents of the files in our views folder. We'll need to use Node.js' File System module to read the contents of our files.
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
So remember in our app JS file we said
that we were going
0:00
to create a function that handles the
reading of files and match the values in.
0:03
We're gonna read from the file.
0:08
And then merge, merge the values in.
0:09
Well, we're not gonna do that here in the
app JS file.
0:11
It's just too much of a disconnect of what
this app is.
0:15
The app should just be like, okay, bump.
0:19
This sets up the server, we're done.
0:21
We do all the routing in the router JS
file.
0:23
And in turn, we should probably move this
into its own file as well.
0:27
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