Skip to content

this is the tutorial of node js . In Which you can learn the nodejs and apply on the projects..Happy Coding

Notifications You must be signed in to change notification settings

Amanchouhan192/Node_Tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

Node_Tutorial

this is the tutorial of node js . In Which you can learn the nodejs and apply on the projects..Happy Coding

About NodeJS

  • Node.js is an open source server framework
  • Node.js is free
  • Node.js runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
  • Node.js uses JavaScript on the server

How to Install Node.js with NPM on Windows

Follow the step to Install the Nodejs on Windows..

  • Open the browser And Type Nodejs Downlod
  • And download current version of the Nodejs.
  • Now check the nodejs is install or not open CMD and type node -v and it shows the version current version thats mean the nodejs is install perfectly on your machine amanchouhanwork
  • Now check the Node Package Manger(npm) is install or not Repeat above steps and open cmd type npm -v.

Why we use Nodejs?

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

How to create Nodejs Server?

  • create the file has .js extension.
  • type the below code nodejs server code
const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World\n');
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});
  • for start the server type the node application name or file name Resim hosting: UploadEdit.com
  • now open the browser and type in the url your loacl host address hostname = '127.0.0.1' software using visual studio code(vscode editor)
  • And you get your first Hello world web app
  • when you type wrong method in the server code the you dont get any response on the webpage.
const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
--->  res.endd('Hello World\n');
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});

Different Functionality of nodejs

About

this is the tutorial of node js . In Which you can learn the nodejs and apply on the projects..Happy Coding

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published