kellyskarritt / MI-449-SS17-740-js-server-intro-jtrO3q

0 stars 0 forks source link

Project Feedback #1

Open kellyskarritt opened 7 years ago

kellyskarritt commented 7 years ago

@egillespie Can you take a look at this? It's hosted here and meets the following criteria:

egillespie commented 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:

Remove http://localhost:8080 from links

It 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.

Generate a random joke for each request

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:

kellyskarritt commented 7 years ago

All done! Thanks

egillespie commented 7 years ago

Nailed it! 🔨 :shipit: