-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
๐
๐ข๐ง๐๐ฅ ๐๐๐ซ๐ฌ๐ข๐จ๐ง ๐๐๐ฎ๐ง๐๐ก
- Loading branch information
1 parent
4a4fd97
commit ebe58b3
Showing
391 changed files
with
21,211 additions
and
10,984 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
FUTURE WORK | ||
|
||
1.multer is used as middleware to upload images | ||
2.Cloudinary | ||
3.Add Flash functionality to display pop up msg (package : connect-flash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports.isLoggedIn = (req, res, next) => { | ||
|
||
if (!req.isAuthenticated()) { | ||
console.log("You must login first"); | ||
return res.redirect('/login'); | ||
} | ||
next(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const mongoose = require('mongoose'); | ||
const passportLocalMongoose = require('passport-local-mongoose'); | ||
const Product = require('./product'); | ||
|
||
const userSchema = new mongoose.Schema({ | ||
|
||
email: { | ||
type: String, | ||
required: true, | ||
unique: true, | ||
}, | ||
cart: [ | ||
{ | ||
type: mongoose.Schema.Types.ObjectId, | ||
ref:'Product' | ||
} | ||
] | ||
|
||
}); | ||
|
||
userSchema.plugin(passportLocalMongoose); | ||
module.exports = mongoose.model('User', userSchema); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.