Lecture Slides: Study-Saturday-Week-1
- For now, moodels are just objects that live in express app score
```
Test {id : 0, score: 99, subject : 'Physics', studentID : 2}
Student {id : 0, name : 'Ashi'}
- Necessary routes:
- Get all students
- Get all test scores
- Update student name
- Update test score
- Get mean test score by student ID
- Get top scoring student
- Delete Student
- Delete Score
- Add Student
- Add Score
- GET: use your browser
- POST / PUT / DELETE :
- CLI (command line interface) with
curl
- e.g.
curl -H "Content-Type: application/json" -X POST -d '{"username":"kate","password":"1234"}' http://localhost:3000/api/login
-H
: headers.-X
: verb.-d
: data (must be of the type specified in headers). http://[address]:[port]/[route_path]
- e.g.
- Postman