Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 23, 2021 03:11 pm GMT

Node JS

JWT

JWT means JSON Web Token. Its used to share secretly information between to parties client and server.JWT use as a secure way to authentication share user information. JWT mechanism to verify the owner of JSON.

How JWT Token Work?

JWT token based authentication, and its stateless. That means the user state is never saved in server memory but the state is sorted inside the token . JWT request to other parties.

JWT have of 3 parts .

  1. Header
  2. Payload
  3. Signature

JWT Look Likes

Aaaaaaaaaa.bbbbbbbbbbbbb.cccccccccccc
The first part is header and second part is payload and the last part is signature.

Mongoose

Mongoose is a mongodb ODM (object database modeling). Mongoose is a way to make connection mongodb database. It provide mongodb validation. Its very simple and it make development first. And it includes query , validation, and logic hook.

It work in asynchronous environment .

Installation mongoose :
npm install mongoose

CRUD Operation

Crud are the four basic operation its create , read, update, delete. The crud operation is refers to the major operation which are implement by database. It can also describe the user interface convention that allow searching , modifying .

Create
The create function allows to user record create in the database. The create function is called INSERT.

Read
The read function is search specific function and read there value.

Update
The update function is modify existing record that exist in database.

Delete
The delete function allows user to remove record in the database.

Express of Node JS

Express js is a back end web application framework for node js. Its a free and open source .
It designed for building web application and API.

Following are some of the core feature of express framework:
Respond HTTP request
Allows the middleware
Allows to dynamically render to HTML pages.

Installation command :
npm install express

Example:
const express= require(express);
const app = express();


Original Link: https://dev.to/munni2244/node-m88

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To