Skip to content

Commit

Permalink
add students get route, change student post from /student to /students
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryntak94 committed Jul 2, 2019
1 parent 899fc42 commit 965eaac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,10 @@ server.post("/student", (req, res) => {
})
.catch(err => console.log(err.message));
});

server.get("/students", (req, res) => {
db("students")
.then(rows => {
res.status(200).json(rows)
})
})

0 comments on commit 965eaac

Please sign in to comment.