![]() ![]() It takes advantage of the fact that servers spend most of their time waiting for I/O operations, like reading a file from a hard drive, accessing an external web service or waiting for a file to finish being uploaded, because these operations are much slower than in-memory operations. Node.js uses an event loop instead of threads, and is able to scale to millions of concurrent connections. "Every I/O operation in Node.js is asynchronous." While this is fine for many applications, the thread-based model does not scale well with many long-lived connections like you would need in order to serve real-time applications like instant messaging apps. Web servers like Apache that are used to serve PHP and other CGI scripts are thread-based because they spawn a system thread for every incoming request. Node.js is a bit different from other server technologies, because it is event-based rather than thread-based. JavaScript has traditionally only run in the web browser, but after considerable interest in bringing it to the server side as well, Node.js was created. By the end, you'll go on to build a weather API with Node.js and Express. This tutorial will walk you through the installation of Node and show you how to write your first "Hello World" program. It allows JavaScript to be used end to end, both on the server and on the client. Node.js is a major framework for modern web development and makes it easy to create high-performance, real-time web applications.
0 Comments
Leave a Reply. |