Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
All right.
So now it's time for challenge 8. And the goals for this challenge is to update the code so that
when we go over to our compose page and we type something, let's say, Day one right? And we click publish
then it should be at the console log what we typed in here into our console.
So that means if we type something else say, another post, andwe click publish then we should see that immediately
in our console.
So this one is a little bit more challenging but there's nothing new here and you should be able to
complete it or at least give it a really good go.
So pause the video and complete the challenge now.
All right here's your first hint.
Inside our compose.ejs
currently we've only got an input and a button.
In order for this to actually make a post request to our server we're going to have to put it inside
a form so that when we submit the form we can pass over the value that the user typed into this input
over to our app.js.
So pause the video and see if you can use that knowledge to complete the challenge.
All right.
Back for another hint?
So let's add our form into our compose.
ejs and I'm going to put the input and the button inside that form.
Now you need to make sure that the button is of type submit so that when you actually click on it it
will submit all the content in the form.
Now the other thing you have to check is that your form has a method of post and that the action is
the route that you're going to handle
inside your app.js.
So a good one might be /compose.
So we post to the /compose route and we have an input that is of type text that needs to have
a name
and we have a button that submits the form.
So now see if that was enough for you to be able to complete the challenge. OK.
Here's a hint
3. In order for us to be able to tap into the value of the input that the user puts into this text
box
we have to give it a name. So let's call it something like post title because this is what we're going
to use a little bit later on.
Now it doesn't matter if you call it something else as long as you remember what the name for this input
was.
Now once we submit this form then it's going to go over to our app.js and it's going to try and make
a post request to the /compose route.
Now currently we don't actually address what should happen when somebody makes a post request to that
route.
We only address what should happen when somebody makes a get request to that route.
So you're going to need to add a post method inside here to tell the server what it should do when somebody
makes a post request to the /compose route. See if that was enough for you to be able to now complete
the challenge.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.