NODE js
- Node JS is a open source environment
- It's sever side isn't a programming language
- It's helps to run Javascript code on sever side
- It's support all 0S
- Very Fast
- It's has Single threaded module
- No buffering data
- Non blocking and Asynchronous
- Runtime environment With Javascript Library
- Node JS modules same as Javascript Libraries.
- Node JS has lot of built in modules
- You can create your own modules
- http:-To Connect http server
- https:-To Connect https server
- fs:- To Handle file system
- events:-To Handle events
- path:- To Handle file Paths
- url:-To parse url string
- HTTP stands for Hyper Text Transfer Protocol
- WWW stands for World Wide Web
- WWW is about communication between web clients and server
- Its done by sending HTTP requests and receiving HTTP responses
- A client (Browser) sends HTTP request to the web
- And web server receives the request
- The server runs an application to process the request
- The server returns an HTTP response to the browser
- The client receives the response.
- Use require directive to load Node JS modules.
- HTTP module is a build in module of Node JS,Which allows Node JS to transfer data over the hyper text Transfer Protocol
- The HTTP module use the createServer() Method to create an HTTP server
- If the response from the HTTP server is supposed to be displayed as HTML ,you should include an HTTP header with a content type.
- HTTP server that listens to server ports and gives a response back to the client.
- The function passed into the http.createServer() method,will be executed when someone tries to access the computer on port 8080
- Import file system module using require keyword
- The Node JS file system module allows to create,read,write,update,delete or rename the files on your computer
- Inside the callback function we pass the first parameters as err for printing the error message when the file have an error.
- URL module splits up a web address into readable parts.
- Parse an address with the url.parse() method,and it will splite a URL object with each part of the address as properties
- Host: localhost:8080
- Path name: Ann.html
- We can use Nodemailer Module to send Gmail from our system.
- We have to install Nodemailer from npm using "npm install nodemailer"comand
- You can compose a mail in various format such as text,html.