Node js- BuiltIn-Modules
Nodejs-Built-in-HTTP-Module
HyperText Transfer Protocol (HTTP) is mainly used for transmitting multimedia documents, and improving collaborative and distributed features of an application.
Routes are specific URLs to which you make an HTTP Request. If you load a website the web browser sends a request to the web server to get the html that defines the website you are loading. Developed as a client-server protocol,The server decodes the HTTP request and sends it to the corresponding application or server for further processing. Making an HTTP request is basically making a request to your web browser to get data. This request is called ‘GET’. There are different types of HTTP requests that can be made depending on what the user wants to do: the basic operations that a user may look to perform are to Create a record, Read a record, Update a record, or Delete a record.
You can create a record by making a POST or PUT request. The difference between PUT and POST is that PUT will create a new record (as with POST) if no such record exists, or, it will replace an existing record if the record already exists within that aforementioned data structure.
const http = require('http');
const myServer = http.createServer((request,response)=>{
response.write("Welcome to Node JS Course");
response.end()
})
myServer.listen(5500)