Category : express

I’m having issues with this .here is my whole code exports.create = async (model) => { count({email:req.body.user},function(result){ if(result < 0){ res.json("The email already exist") } else{ model.password = await bcrypt.hash(model.password, 10) let entity = new User({}) await set(entity, model) await entity.save() return entity } }) can please can anyone tell me what is my error ..

Read more

I’m building an app using FEAN stack so Angular is my front-end framework and ExpressJS is my back-end framework. I’m using Firebase Cloud Functions to separate my back-end from my front-end. I’ve been googling a lot but almost everything I found is connecting Firebase directly to Angular using AngularFire but it is not an approach ..

Read more

This is my user Schema. usermodel.js const userSchema = new Schema ({ user_name:String, full_name:String, user_email:String, user_pswd:String }); In my index.js file I am using these middle wares. index.js app.use(express.static(path.resolve(__dirname+’/views’))); app.use(session({ secret:’secret-key’, resave:false, saveUninitialized:true, })); app.use(function(req, res, next) { res.locals.user = req.session.user; next(); }); I am storing a user session once a user is logged in. ..

Read more