JoBat update

A Virtual World of Infotainment :)

Code Explanation Video Link :

https://youtu.be/zwuUdpF4Egk Code :
const express = require("express");
const app = express();
app.use(sayMyName);
app.get("/", isLoggin, (req, res) => {
  console.log("After middleware");
  console.log(req.user);
  res.send("Welcome to JoBat Virtuschool");
});

function sayMyName(req, res, next) {
  console.log("In MiddleWare");
  next();
}

function isLoggin(req, res, next) {
  if (req.query.isLogin === "true") {
    console.log("Login user");
    req.user = "Jobat user";
    next();
  } else {
    res.send("Access Denied");
  }
}

app.listen(5000, () => {
  console.log("Server Running");
});
Newer Posts Older Posts Home

SUBSCRIBE & FOLLOW

POPULAR POSTS

  • CBFC's new rules..!
  • Aval Movie Review
  • Square Matrix-Corner Elements Sum
  • Sketch Movie Review
  • Aramm Movie Review
  • Mersal Movie Review
  • Tyrese Gibson Threatens To Quit FF Franchise..!
  • JBM awards 2k18
  • Windows 10 May 2020 Update How to Download it and its features
  • Middlewares in Express JS

Categories

  • Awards 4
  • Code 23
  • Review 19
  • sport 1
  • Tech 20
  • Update 19

Contact Form

Name

Email *

Message *

  • ▼  2020 (3)
    • ▼  July (1)
      • Middlewares in Express JS
    • ►  May (2)
  • ►  2019 (8)
    • ►  October (1)
    • ►  July (1)
    • ►  June (1)
    • ►  February (1)
    • ►  January (4)
  • ►  2018 (52)
    • ►  October (3)
    • ►  September (3)
    • ►  August (2)
    • ►  July (3)
    • ►  June (5)
    • ►  May (1)
    • ►  April (10)
    • ►  March (19)
    • ►  February (1)
    • ►  January (5)
  • ►  2017 (19)
    • ►  December (3)
    • ►  November (8)
    • ►  October (8)

Search This Blog

Powered by Blogger.

Report Abuse

HOME

  • HOME
  • Code Block
  • Tech World
  • How is it?
  • What's Up?
  • JoBatMovie_Awards
  • Sports Block
  • Privacy Policy

JoBatMovie Awards

  • Home
  • JoBatMovie Awards
  • Home

Featured post

JBM awards 2k18

JoBat Updates

Designed by OddThemes | Distributed by Gooyaabi Templates