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) }
func getUser(c *echo.Context) error { return c.JSON(http.StatusOK, users[c.P(0)]) }
func getUsers(c *echo.Context) error { return c.JSON(http.StatusOK, users) }