On Habré and not only already many times there were topics about this web server. He is fast, he works on JS. But for what purpose is it needed?

I have already tried to deal with it, until all that happened - a static page with a counter that for some reason adds 2 and not 1 as expected. It seems that on its base does not create a site in the classic sense.

  • For those who are friends with English and want to understand better - how it works and where it can be used, this link can be useful - Zowie
  • one
    And 2 added because the default browser makes a request to the server in an attempt to get favicon.ico , your “server” didn’t check what it was requesting and didn’t react properly, therefore with each page request the counter increased by 2. About not creating a website - with such an understanding of how the server works - you really won't be able to write something. On java, you would not write a 100% website either, but this does not mean that it cannot be done: D At the moment, nodejs has everything to create high-load vertically and horizontally expandable servers. - Zowie

2 answers 2

As I understand it, the developer (s) and does not set (set) the goal to create a full-fledged server. From the paragraph About (or rather the first lines) it follows that this is just a miniature tool for working with sockets and similar means of "communication".

  • It seems to respond to Ajax requests quickly. I'm just wondering what else can be done with his help other than a tool for instant messaging. - Sergey
  • nodejs.ru there seems to be something interesting there is a kind of file upload. at least something) - Sergey

How is it impossible? You can all the same, only the language on the server - JavaScript. Yes, look at the Offsite Node.JS .. there right on the main page shows how this is done.

while all that happened is a static page with a counter which for some reason adds 2 and not 1 as it should be

If the page is static, then where does the Node.JS? And if not, then it is no longer static. In both cases, it is not his joint;)

  • Is it possible to split the site into pages? Like classic apache or nginx or iis or some other http server? - Sergey
  • And it is not for creating websites, purely system garbage, as I understand it. - uramer239
  • one
    Well, because no one forbids you to divide your code into files ... and how it looks externally - it does not matter at all. The concept of a file for a web server is quite relative. - cy6erGn0m