{"size": 1292, "ext": "js", "max_stars_repo_path": "NODE-EXPRESS/NodeJs-ExpressJs-Mongodb-With-Mongoose-master/ExpressEjsMongooseWithDashboard2/routes/dashboard/dash.js", "max_stars_repo_name": "DevelopByTarun/TODAY-HELP", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "NODE-EXPRESS/NodeJs-ExpressJs-Mongodb-With-Mongoose-master/ExpressEjsMongooseWithDashboard2/routes/dashboard/dash.js", "max_issues_repo_name": "DevelopByTarun/TODAY-HELP", "max_issues_repo_issues_event_min_datetime": "2019-12-20T06:14:41.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-02T08:05:02.000Z", "max_forks_repo_path": "NODE-EXPRESS/NodeJs-ExpressJs-Mongodb-With-Mongoose-master/ExpressEjsMongooseWithDashboard2/routes/dashboard/dash.js", "max_forks_repo_name": "DevelopByTarun/TODAY-HELP", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 34.0, "max_line_length": 81, "alphanum_fraction": 0.653250774}
var express = require('express');

var router = express.Router();


router.post('/dologin',function(req,res){
var userid = req.body.userid;
  var password = req.body.pwd; 
   const userOperations =  require("../../db/usercrud.js");
  const User = require("../../helpers/User.js");
  const userObject = new User(userid,password);
  userOperations.search(userObject,res,req);
  //userOperations.update();
});

router.post('/login',function(request,response){
    console.log("Request is ",request);
    //response.send('I am in Login');
  var userid = request.body.userid;
  var password = request.body.pwd; 
  //  var userid = request.query.userid;
   // var password = request.query.pwd;
  const userOperations =  require("../../db/usercrud.js");
  const User = require("../../helpers/User.js");
  const userObject = new User(userid,password);
  userOperations.add(userObject,response); 
  // if(userid==password){
       // response.send('<html><body><h1>Welcome '+userid+"</h1></body></html>");
        /*let path = require("path"); 
        let fullPath = path.join(__dirname,'/public/welcome.html');
      // response.sendFile(fullPath);
    response.render('welcome',{user:userid});
    }
    else{
        response.send('Invalid Userid or Password ');
    }*/
});
module.exports=router;