Skip to main content

Node.js Notes

Node.js Notes



Node js handle request asynchronously using single thread.

Waiter(Thread) :

Table1 (Request 1)                           Table 2 (Request 2)

Thread read request 1 and wait for response at the same time goes to table 2 and process there request and if event queue alert with request is processed of table 1 then it response to table 1 and so on.


Node should be used for real time application where we need data intensivity. not for cpu intensive application


Installation :
npm i
npm i express --save
npm i -g nodemon (For auto rerun)
npm i --save-dev nodemon (For dev dependency save for development purpose)


Comments

Popular posts from this blog

VERCEL DEPLOYMENT ERROR

 VERCEL DEPLOYMENT ERROR Options | NextAuth.js (next-auth.js.org) Step 1 : cmd $ openssl rand -base64 32 (Copy generated key) Step 2: Go to Project Environment Variables Add NEXTAUTH_SECRET : Key  Step 3: Redeploy

Convert React Native To Expo

Convert React Native To Expo Step 1: Add Into App.json   "expo" : {     "sdkVersion" : "44.0.0" ,     "name" : "AwesomeProject"   } Step 2: Add this into your package.json    "dependencies" : {     "expo" : "^33.0.7" ,     "react" : "17.0.2" ,     "react-native" : "0.67.2"   }, Step 3: Make your Index.js file look like this AppRegistry . registerComponent ( 'main' , () => App ); Step 4: Install expo in your project folder In terminal paste npm install --save expo / npm install (If necessary)

Using Same Firebase for Web App as well as Android App

Using Same Firebase for Web App as well as Android App Create Android app in that project go to project setting click on iso or android or web icon.  Go to authentication select Google then enable select email Get client id from web sdk - Create.env.local  GOOGLE_CLIENT_ID=259eklrjelkjr GOOGLE_CLIENT_SECRET=GOlkelkrjer NEXTAUTH_URL=https://localhost:3000 - Restart the server/app - Create folder in pages/auth/signin.js