Skip to content
Home » Blogs » Getting Started NodeJS + Writing Hello World! | Node.Js Tutorial #1

Getting Started NodeJS + Writing Hello World! | Node.Js Tutorial #12 min read

Getting Started NodeJS + Writing Hello World! | Node.Js Tutorial #1

Hey Programmers, In this Post We Will Starting With Node.js And In Further Post We will be Working With Node.Js Modules And Other Things Like HTTP Module, Console, MySQL Linking With Node.js, Creating DataBase, File System, And More. Before Working With Node.js First Make Sure Node.Js Is Installed In your System.

Table Of Contents:

  • What is Node.js?
  • Installing Node.js
  • Creating a Baisc HTTP Server Using HTTP Module
  • Conclusion

What is Node.js?

2560px Node.js logo 2015.svg

Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on a JavaScript Engine and executes JavaScript code outside a web browser, which was designed to build scalable network applications.

What is NodeJS used for?

Nodejs is mainly used for non-blocking event servers, due to its single-threaded nature. It is used for traditional websites and back-end API services, but is designed with real-time push architectures in mind.

Installing Node.js

Step 1: Go to Node.js Official Website Which is https://nodejs.org/ And Download Your Version Of Node.js According To Your Operating System.

Step 2: Run the Node.js Setup And Install It With the Default Settings:

image

Once You Have Installed Node.js Click On the Finish Button.

HTTP Module In Node.js

In Node.js, There is a Bult-In Module Called HTTP (Hyper Text Transfer Protocol) Which Allows Us to Listen to Server Ports & Give the Responce Back to the Client.

Use the createServer() method to create a HTTP Server::

var http = require('http')

// Create a Basic Web Server
http.createServer(function (req, res){
  res.write('Hello World!');
  res.end();
}).listen(3000);

Output:

image 1

Conclusion

From this We Have Installed Node.js + Created Our First Program In Node.js, So this was It for this Post Se you In the Next One Till then Keep Coding Keep Exploring!

Tanmay Sinha

2 thoughts on “Getting Started NodeJS + Writing Hello World! | Node.Js Tutorial #12 min read

  1. Pingback: Modules In NodeJs | Node.Js Tutorial #2 - Mr Programmer

  2. Pingback: What is Node Package Manager? | Node.Js Tutorial #3 - Mr Programmer

Leave a Reply