|
|
@ -50,6 +50,9 @@ func runWeb(*cli.Context) { |
|
|
|
|
|
|
|
|
|
|
|
// Routers.
|
|
|
|
// Routers.
|
|
|
|
m.Get("/", middleware.SignInRequire(false), routers.Home) |
|
|
|
m.Get("/", middleware.SignInRequire(false), routers.Home) |
|
|
|
|
|
|
|
m.Get("/issues", middleware.SignInRequire(true), user.Issues) |
|
|
|
|
|
|
|
m.Get("/pulls", middleware.SignInRequire(true), user.Pulls) |
|
|
|
|
|
|
|
m.Get("/stars", middleware.SignInRequire(true), user.Stars) |
|
|
|
m.Any("/user/login", middleware.SignOutRequire(), binding.BindIgnErr(auth.LogInForm{}), user.SignIn) |
|
|
|
m.Any("/user/login", middleware.SignOutRequire(), binding.BindIgnErr(auth.LogInForm{}), user.SignIn) |
|
|
|
m.Any("/user/logout", middleware.SignInRequire(true), user.SignOut) |
|
|
|
m.Any("/user/logout", middleware.SignInRequire(true), user.SignOut) |
|
|
|
m.Any("/user/sign_up", middleware.SignOutRequire(), binding.BindIgnErr(auth.RegisterForm{}), user.SignUp) |
|
|
|
m.Any("/user/sign_up", middleware.SignOutRequire(), binding.BindIgnErr(auth.RegisterForm{}), user.SignUp) |
|
|
@ -67,7 +70,12 @@ func runWeb(*cli.Context) { |
|
|
|
m.Any("/repo/create", middleware.SignInRequire(true), binding.BindIgnErr(auth.CreateRepoForm{}), repo.Create) |
|
|
|
m.Any("/repo/create", middleware.SignInRequire(true), binding.BindIgnErr(auth.CreateRepoForm{}), repo.Create) |
|
|
|
m.Any("/repo/delete", middleware.SignInRequire(true), binding.Bind(auth.DeleteRepoForm{}), repo.Delete) |
|
|
|
m.Any("/repo/delete", middleware.SignInRequire(true), binding.Bind(auth.DeleteRepoForm{}), repo.Delete) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m.Get("/help", routers.Help) |
|
|
|
|
|
|
|
|
|
|
|
m.Get("/:username/:reponame/settings", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Setting) |
|
|
|
m.Get("/:username/:reponame/settings", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Setting) |
|
|
|
|
|
|
|
m.Get("/:username/:reponame/commits", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Commits) |
|
|
|
|
|
|
|
m.Get("/:username/:reponame/issues", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Issues) |
|
|
|
|
|
|
|
m.Get("/:username/:reponame/pulls", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Pulls) |
|
|
|
m.Get("/:username/:reponame/tree/:branchname/**", |
|
|
|
m.Get("/:username/:reponame/tree/:branchname/**", |
|
|
|
middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Single) |
|
|
|
middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Single) |
|
|
|
m.Get("/:username/:reponame/tree/:branchname", |
|
|
|
m.Get("/:username/:reponame/tree/:branchname", |
|
|
|