Open kellyskarritt opened 7 years ago
Hi @kellyskarritt, this is a fantastic start! It looks like you really captured the idea of manual routing (a.k.a. the giant if
/else
block of doom).
There are a couple of quirks with the content you're generating, though:
http://localhost:8080
from linksIt looks like all of your links are pointing at http://localhost:8080
. If you remove this, then your links will work no matter where you deploy your hosted site.
Right now you're generating a random number one time at the top of your code. If I refresh the page, I will never get a new random joke.
That's because only the code between lines 4 and 51 run each time I go to a page on your site. All of the other code runs once when the server starts.
If you move your random number generator inside your createServer
function, it should show a new random joke when I refresh the page.
After you’ve made your changes and pushed them to GitHub and your hosted site, give it a once-over to make sure it looks right, then comment back here and I’ll take another look.
Thanks! :rocket:
All done! Thanks
Nailed it! 🔨 :shipit:
@egillespie Can you take a look at this? It's hosted here and meets the following criteria:
h1
element (though for this project, it doesn't have to be a complete HTML page)/
, they see a greeting/random-joke
, they see one of at least three knock-knock jokes (Math.random()
may be useful 😉)/cuteness
, they see a picture of a cute animal (I'm sure you can find one on the Internet 😛)/
) contains a link to it