Skip to content

Commit 3b9fa82

Browse files
authored
Merge pull request #138 from FeruzOripov/patch-1
getAllUsers
2 parents 48004dd + de20823 commit 3b9fa82

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cookbook/crud/server.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ func deleteUser(c echo.Context) error {
5757
return c.NoContent(http.StatusNoContent)
5858
}
5959

60+
func getAllUsers(c echo.Context) error {
61+
return c.JSON(http.StatusOK, users)
62+
}
63+
6064
func main() {
6165
e := echo.New()
6266

@@ -65,6 +69,7 @@ func main() {
6569
e.Use(middleware.Recover())
6670

6771
// Routes
72+
e.GET("/users", getAllUsers)
6873
e.POST("/users", createUser)
6974
e.GET("/users/:id", getUser)
7075
e.PUT("/users/:id", updateUser)

0 commit comments

Comments
 (0)