Example #1
0
File: server.go Project: erivan/vvt
func createUser(c *echo.Context) error {
	u := new(user)
	if err := c.Bind(u); err != nil {
		return err
	}
	users[u.ID] = *u
	return c.JSON(http.StatusCreated, u)
}
Example #2
0
File: server.go Project: erivan/vvt
func getUser(c *echo.Context) error {
	return c.JSON(http.StatusOK, users[c.P(0)])
}
Example #3
0
File: server.go Project: erivan/vvt
func getUsers(c *echo.Context) error {
	return c.JSON(http.StatusOK, users)
}