공태현

Install mongoose and Write user-schema

const mongoose = require('mongoose');
const userSchema = new mongoose.Schema({
name : {type : String, required : true, unique : true, },
password : {type : String, required : true, trim : true},
});
module.exports = mongoose.model('squartuser', userSchema )
......@@ -5,7 +5,7 @@
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start" : "node server.js"
"start": "node server.js"
},
"repository": {
"type": "git",
......@@ -14,6 +14,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.1"
"express": "^4.18.1",
"mongoose": "^6.3.4"
}
}
......