Git Product home page Git Product logo

backend-endgame-1's Introduction

Express generator

  • express generator ek folder baba ke detaa hai, jiska matlab aapko khudsee folder nahi babaa haai, to expreess generato saree files ko is folder mein daal deeegaa

Steps:

  • jivan mee ekbar laptop ke install karoo globaly " npm i express-generator -g " to creat new app anywhere: open cmd move to desktop create new app: "express appname --view=ejs" now use two comands
  • cd appname
  • npm i open it on vs code

To run the code type npx nodemon in terminal

Database

  • Khandann is puraa DATABASE --> uskee andarr chotaa chotaa parvar/family haai collection --> uskee andarr hum joo haai chote chote admi haai woo haai collection....

Code Side --> Mongoo DB Side

  • DB Setup --> DB Formation
  • Model --> Collection
  • Schema --> Document

MOngo DB:

  • install mongodb
  • install mongoosejs npm i mongoose
  • require and setup connection const mongoose = require("mongoose"); mongoose.connect("mongodb://127.0.0.1:27017/practicekaro");
  • make schema -> iska matlab aapko yee batana baane waala haar document mei kya kya hogaa mongoose.Schema({ username: String, name: String, age: Number, })
  • create model and export module.exports=mongoose.model("user", userschema);

Session-

  • install session npm i express-session

  • create req.session.koibhinaam = koibhivalue;

  • read req.session.koibhinaam

  • delete req.session.destroy

Cookie

  • Setup res.cookie("name",value);
  • Cookie reading req.cookie.name -cookie delete res.clearCookie("name")

backend-endgame-1's People

Contributors

raktim2022 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.