Example #1
0
func (pC *UsersController) GetRoutes() []*routes.WebRoute {
	return []*routes.WebRoute{
		routes.NewWebRoute("CreateUser", "/v1/users", routes.POST, pC.Create),
		routes.NewWebRoute("ReplaceUser", "/v1/users/:userId", routes.PUT, pC.Replace),
		routes.NewWebRoute("GetUser", "/v1/users/:userId", routes.GET, pC.GetOne),
		routes.NewWebRoute("GetUsers", "/v1/users", routes.GET, pC.List),
		routes.NewWebRoute("DeleteUser", "/v1/users/:userId", routes.DELETE, pC.Delete),
	}
}
Example #2
0
func (pC *PostsController) GetRoutes() []*routes.WebRoute {
	return []*routes.WebRoute{
		routes.NewWebRoute("NewPost", "/v1/posts", routes.POST, pC.Create),
		routes.NewWebRoute("ReplacePost", "/v1/posts/:postId", routes.PUT, pC.Replace),
		routes.NewWebRoute("GetPost", "/v1/posts/:postId", routes.GET, pC.GetOne),
		routes.NewWebRoute("GetPosts", "/v1/posts", routes.GET, pC.List),
		routes.NewWebRoute("DeletePost", "/v1/posts/:postId", routes.DELETE, pC.Delete),
	}
}