Home
Responsive design
Responsive Layout One page corresponds to multiple devices. When the device screen/pc webpage size changes, the page layout (not the element/text size) will be changed automatically. There
Error handling
Method 1: try catch wraps the async request 1234567891011async function addStudent(req, res){ const {firstName, lastName, email} = req.body; const student = new Student({
Project structure
Create a project First create the src folder in the project folder, then create the entry file index.js in it, then run npm init -y . Then install express, dotenv, cors, morgan, Mongoose packages. n
Relationships
Association (similar to sql) In sql, the association may be 1-to-many, and the many parts may be 0, 1, and Many. The data in Mongodb is stored in the form of an array, so it may be 0 data, regardles
Interface (Summary)
Create interface steps (summarize previous lessons) Create the basic server: app.js 123456const express = require('express')const app = express()//main codeapp.listen(80, function(){
Middleware classification
Classification of middleware Express officially divides common middleware usage into five categories: Application-level middleware Route-level middleware Error-level middleware Express built-in