twalker12 / MI-449-SS17-741-js-server-intro-jtrO3q

0 stars 0 forks source link

Project Feedback #1

Open twalker12 opened 7 years ago

twalker12 commented 7 years ago

Build a simple web server that handles any URL

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

twalker12 commented 7 years ago

Can you take a look at this? I have error and I'm not sure what's wrong. I also document.write but I'm not sure if i'm supposed to use that or response.write because I saw both when I googled it. Can you tell me what I need to fix? Thanks

stuartpearman commented 7 years ago

Hey Tamesha,

The server won't run for a few reasons. First, some of your response.end functions are missing quotes.

When you have something like this:

response.end(<a href="...">...</a>)

it won't render unless you add quotes:

response.end('<a href="...">...</a>')

You also want to make sure that you're using response.end or response.write. document.write won't do anything in this case. If you do use response.write, you'll also have to call response.end() afterward, otherwise the page will look like it's trying to load something even after everything has already been displayed.

You also use a variable that hasn't been defined here: rnd. Not sure if you had a variable by that name before and removed it, but as a general rule, javascript will try to read anything that's not surrounded by quotes as code. Anything that is surrounded by quotes will be read as a string. Unless the code you're using is build into javascript, you'll have to create any variable you want to use.

twalker12 commented 7 years ago

Ok I made the changes it still doesn't seem to be working.

stuartpearman commented 7 years ago

Ok, what else have you tried? Have you linted your code for errors?

stuartpearman commented 7 years ago

Hi @twalker12, don't spend any more time on this. I'm putting together an alternative assignment for you.

stuartpearman commented 7 years ago

Hi Tamesha, I just sent you an email! Make sure to check it as it contains details for an alternative assignment 🙂