3

I learning to code and have played around with npm, webpack, and http-server. I usually use http-server and then open up local host to see the changes that I've made through React that ends up on index.html. But I notice that this works too if I just open the index.html file in Chrome or another browser. What's the point of opening http-server?

akantoword
  • 2,824
  • 8
  • 26
  • 43

1 Answers1

1

Some cases require a server, like ajax. Many things don't require a server, but after a while developers just get used to having a local server around.

Aaron Cicali
  • 1,496
  • 13
  • 24
  • 2
    why ajax require a server? – akantoword Mar 26 '16 at 00:42
  • 1
    I'm guessing that for Javascript to load a local file it would be a security risk. Anyways, there's a difference between what comes back from a server and loading a local file. The server sends back response headers. – Aaron Cicali Mar 26 '16 at 13:44