All right. 1
Are you ready for the answer for this challenge? 2
Now we know that we firstly need to include a header and a footer. 3
So let's head into this compose.ejs page which is currently empty 4
and add in those partials, the header and footer. 5
And again to save time I'm just going to copy and paste this over here. 6
But you should try and type it out if you have the time. 7
Now inside here instead of having an h1 that says home it's going to be an h1 that says compose. 8
And we don't have a paragraph tag 9
instead we want a input that's of type text. 10
I'm going to leave the name to be blank for now but I'm going to delete this value over here. And the other 11
element we need is a button element and it's type 12
is going to be of type submit so that when we click on it our form gets submitted. So later on when we create 13
a form around this and we click on this button, it'll submit our form. And in between all tags we're going 14
to give up button a title of publish. 15
So now if we hit save 16
this is still not enough to render a compose page. 17
Remember if we want to be able to reach it through our server then we need to add a get method. 18
So app.get, when people trying to get or reach /compose we're going to respond with res. 19
render the compose page and we're not going to pass over any data for this page. 20
So now if we hit save and we refresh our website we should be able to head over to home and if we change 21
the URL to compose then that should take us to our compose page with our h1, our text input and our 22
button.