Loading
Leon Noel
This is a live streamed presentation. You will automatically follow the presenter and see the slide they're currently on.
"Who is that surrounding me?
Enemy, enemy you crossed the wrong boundary, poof!
Wicked witness wizardry
Disappear from here and end up in a tree
Crossed the wrong boundary"
Homework: https://forms.gle/MUdE5XCY7VGKup1y8
Please Triple Check Before You Submit! No incomplete / fake work. It just makes my life more difficult and won't help you...
Step 1: Go to File > Preferences > Settings
Step 2: search for "workbench.editor.labelFormat"
Step 3: select medium from a drop-down
Client
Server
someurl.com/todos
Loggining In or Signing Up redirects you to
Server
Running Code
We Wrote
To Handle The Request
Bottom of server.js file
Top of server.js file
routes/todos.js
routes/todos.js
routes/todos.js
routes/todos.js
middleware/auth.js
routes/todos.js
controllers/todos.js
routes/todos.js
controllers/todos.js
controllers/todos.js
models/todos.js
Collection
document
document
document
document
Mongoose provides a straight-forward, schema-based solution to model your application data.
Collection
document
document
document
document
Each schema maps to a MongoDB collection and defines the shape of the documents within that collection.
const UserSchema = new mongoose.Schema({
userName: { type: String, unique: true },
email: { type: String, unique: true },
password: String
})Collection
document
document
document
document
Models are fancy constructors compiled from Schema definitions. An instance of a model is called a document.
Models are responsible for creating and reading documents from the underlying MongoDB database.
module.exports =
mongoose.model('User', UserSchema)controllers/todos.js
views/todos.ejs
controllers/todos.js