/why-node-js

Simple demo for event loop ipc and http server showing core modules

Primary LanguageJavaScript

NodeJs

The code base has snippets for node js event loop and http server.

Running Event loop ipc demo

  • Clone the repo
  • Open terminal and run command node ipc.js
  • Open another terminal and run command ./signal.sh
  • It terminates the node process in first terminal as event loop quits.

Running Http Server

  • Open the terminal run command node server.js
  • This creates a Http server on port 9000 and open it in chrome after 5 seconds.

Note

The code is designed on mac and some os specific things wont work like .sh and opeing the browser. You can check the alternatices for your system.