All right it's time for challenge 1
5. So currently we've got our home route and our home page being rendered with a header and footer 2
and some content that's being passed over from the server. 3
Now in this challenge in order to complete it, I want you to be able to go into your browser and say 4
localhost:3000/about and be able to see the about page with the same header and footer and CSS 5
applied to this page. And also to be able to go over to the contact page and again have this page rendered 6
with a header and footer using the partials and also have the data that's inside our app.js, 7
about content and contact content rendered and passed over to the correct pages. 8
So you should be able to see this on your About page and this on your contact page 9
once you've successfully completed this challenge. 10
So that's the goal. 11
Pause the video and complete the challenge. 12
All right so here's the first and only hint. As a hint I'm going to go through the steps that you need 13
to achieve in order to get this to work. 14
Now we know that we're already able to render our home page passing in some of the content that's inside 15
this variable home starting content. And we're using these partials inside this page to be able to render 16
the content inside the header and footer files. 17
Now in our contact.ejs and about.ejs pages you need to do the same as what we've done inside our 18
home. 19
ejs. But we're going to be passing in some different content and you're going to have a different h1. 20
Now 21
once you've updated these two pages now the next step is to go ahead and create the routes. 22
We've got a route defined for our root route which is the forward slash 23
and inside there we're rendering the home.ejs page and we're passing through a Javascript object that contains 24
the value of home starting content which is the data that we want to pass over to the home page. 25
Now we need to do pretty much the same thing but for our /about route and our / 26
contact route and we're going to pass over the content inside the about content and contact content 27
to the relevant pages. 28
So see if you can try and replicate what we did with the home.ejs file and also this get method for 29
the root route and you should be able to reach the goal for this challenge. 30
So give it a go 31
now.