Back End Setup
1. Create Mongoose User model
var Mongoose = require('mongoose');
var Schema = Mongoose.Schema;
// Create Schema Object
var UserSchema = new Schema({
firstName: { type: String },
lastName: { type: String },
username: { type: String, default: '' },
email: { type: String },
password: { type: String },
resetToken: { type: String },
resetTokenExpires: { type: Date },
status: { type: Boolean, default: true },
googleId: { type: String },
profileImage: { type: String, default: '' }
});
// This will creates database collection named "Users" in the Database
var Users = Mongoose.model('Users', UserSchema);
module.exports = Users;
2. Set up API route, ensuring compatibility with passportJS
3. Testing With Postman
Last updated