sudo npm install typescript ts-node express node @types/express @types/node nodemon @types/node
npm install -g typescript ts-node
npm install mongoose @types/mongoose
npm i body-parser @types/body-parser
npm install --save express-validator
npm install joi npm install --save @types/joi
200-226 : mean action requested by the client was recieved understood and accepted.
200: success
300-308 : status code indicate the client must take addition action to complete the request.
307 Temporary Redirect
308 Permanent Redirect
400-451 : this class of status code is intended for situations in which the error seems to have been
caused by the client.
404 Not Found
400 Bad Request
401 Unauthorised
402 Payment Required
403 Forbidden
500-511 : indicate case in which the server is aware that it has encountered an error or is otherwise
incapable of performing the request.
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable
npm i nodemailer npm i @types/nodemailer
npm i nodemailer-sendgrid-transport
npm i bcrypt
npm i jsonwebtoken
npm i @types/jsonwebtoken
npm install emailjs
-> And Use the api provided in the documentation.
npm i multer
npm i @types/multer
-> Internally it used the busboy to store the data.
npm i node-schedule npm i @types/node-schedule
Ex.: Take a scenario such as => name, age, Addr:[{zip:'201004'}] 1 and -1 denotes ascending or descending order.
-
Single Field : apply on single field Example: db.user.createIndex({name:1})
-
Compound : apply in multilple field where we form query with multiple conditions Example: db.user.createIndex({name:1, age:1})
-
Multi-Key : apply on field where exist multiple data for eg. there are
multiple address of the single user. Example: db.user.createIndex({address.zip:1}) -
Text : Used in the case such as searching operations. Example: db.user.createIndex({name:'text'})
-
Geo Spatial : For eg. find the result which is near you geo-coordinates. Applied on Geographical Co-ordinates
- Just added in Scheme => index: { background: true, unique: true }
As in development environment the typescript is converted into js by the compiler but for the production environment we have to convert it into javascript.
To Convert to js write in package.json
- "create-bundle" : "tsc && node dist/index.js"
- "start" : "node dist/index.js"
- npm i loadtest -loadtest [-n requests] [-c concurrency] [-k] URL -loadtest -n 100 -c 20 -k "https://node-ts-blog.herokuapp.com/api/user/login"
-
To get the html data from the website use "Request - Simplified HTTP client"
-
npm i request
-
npm i @types/request
-
To get the specific data from the html use "cheerio"
-
npm i cheerio
-
npm i @types/cheerio
-
Demo Website is "https://webscraper.io/test-sites/e-commerce/allinone"