Hello World HTTP server
First, install Node.js for your platform.
In this example we'll create an HTTP server listening on port 1337, which sends Hello, World! to the browser. Note that, instead of using port 1337, you can use any port number of your choice which is currently not in use by any other service.
Save the file with any file name. In this case, if we name it hello.js we can run the application by going to the directory the file is in and using the following command: