{"size": 509, "ext": "js", "max_stars_repo_path": "clientRoutes/helper/registerHelper.js", "max_stars_repo_name": "abhi2718/amazona", "max_stars_repo_stars_event_min_datetime": "2021-10-01T17:00:06.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-17T18:15:32.000Z", "max_issues_repo_path": "clientRoutes/helper/registerHelper.js", "max_issues_repo_name": "abhi2718/amazona", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "clientRoutes/helper/registerHelper.js", "max_forks_repo_name": "abhi2718/amazona", "max_forks_repo_forks_event_min_datetime": "2021-12-02T03:43:45.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-02T03:43:45.000Z"}
{"max_stars_count": 5, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 29.9411764706, "max_line_length": 60, "alphanum_fraction": 0.489194499}
const db=require('../../models/index');
        bcrypt=require('bcryptjs');

        exports.register=(req,res)=>{
            db.User.create({
              name:req.body.name,
              email:req.body.email,
              password:bcrypt.hashSync(req.body.password,8),
              isAdmin:false
          })
          .then(user=>res.json({...user}))
          .catch(err=>res.status(401).json({
            msg:'This email already exists'
          }));
          }

          module.exports=exports;