-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exam1 ngothao (2) #69
base: main
Are you sure you want to change the base?
Conversation
package.json
Outdated
"nodemon": "^2.0.22" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gỡ và cài lại theo dev dependencies
@@ -1,5 +1,7 @@ | |||
{ | |||
"dependencies": { | |||
"dotenv": "^16.1.3", | |||
"env": "^0.0.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gỡ env lib
@@ -0,0 +1,2 @@ | |||
MONGODB_URI=mongodb://127.0.0.1:27017/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bỏ mongodb
@@ -0,0 +1,2 @@ | |||
MONGODB_URI=mongodb://127.0.0.1:27017/test | |||
PORT = 8080 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bỏ .env vào .gitignore
tạo .env.template mẫu push lên
src/models/blog.model.js
Outdated
@@ -0,0 +1,16 @@ | |||
const mongoose = require("mongoose"); | |||
const Schema = mongoose.Schema; | |||
const blogsSchema = new Schema({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blogSchema
src/models/blog.model.js
Outdated
type: String, | ||
}, | ||
}); | ||
const Blog = mongoose.model("Blog", blogsSchema); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blogSchema
deleteBlog, | ||
} = require("../controllers/blog.controller"); | ||
|
||
const blogRouter = express.Router(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
router
No description provided.