Merge pull request #600 from netantho/netantho-584

Fixes #584
This commit is contained in:
Brad Rydzewski 2014-11-06 23:55:32 -08:00
commit 2c75f225d9
2 changed files with 6 additions and 4 deletions

View file

@ -132,7 +132,7 @@ app.config(['$routeProvider', '$locationProvider', '$httpProvider', function($ro
} }
} }
}) })
.when('/:remote/:owner/:name/:branch/:commit', { .when('/:remote/:owner/:name/:branch*\/:commit', {
templateUrl: '/static/views/commit.html', templateUrl: '/static/views/commit.html',
controller: 'CommitController', controller: 'CommitController',
title: 'Recent Commits', title: 'Recent Commits',

View file

@ -1,6 +1,8 @@
package router package router
import ( import (
"regexp"
"github.com/drone/drone/server/handler" "github.com/drone/drone/server/handler"
"github.com/drone/drone/server/middleware" "github.com/drone/drone/server/middleware"
@ -36,9 +38,9 @@ func New() *web.Mux {
repos.Use(middleware.SetRepo) repos.Use(middleware.SetRepo)
repos.Use(middleware.RequireRepoRead) repos.Use(middleware.RequireRepoRead)
repos.Use(middleware.RequireRepoAdmin) repos.Use(middleware.RequireRepoAdmin)
repos.Get("/api/repos/:host/:owner/:name/branches/:branch/commits/:commit/console", handler.GetOutput) repos.Get(regexp.MustCompile(`^\/api\/repos\/(?P<host>(.*))\/(?P<owner>(.*))\/(?P<name>(.*))\/branches\/(?P<branch>(.*))\/commits\/(?P<commit>(.*))\/console$`), handler.GetOutput)
repos.Get("/api/repos/:host/:owner/:name/branches/:branch/commits/:commit", handler.GetCommit) repos.Get(regexp.MustCompile(`^\/api\/repos\/(?P<host>(.*))\/(?P<owner>(.*))\/(?P<name>(.*))\/branches\/(?P<branch>(.*))\/commits\/(?P<commit>(.*))$`), handler.GetCommit)
repos.Post("/api/repos/:host/:owner/:name/branches/:branch/commits/:commit", handler.PostCommit) repos.Post(regexp.MustCompile(`^\/api\/repos\/(?P<host>(.*))\/(?P<owner>(.*))\/(?P<name>(.*))\/branches\/(?P<branch>(.*))\/commits\/(?P<commit>(.*))\/console$`), handler.PostCommit)
repos.Get("/api/repos/:host/:owner/:name/commits", handler.GetCommitList) repos.Get("/api/repos/:host/:owner/:name/commits", handler.GetCommitList)
repos.Get("/api/repos/:host/:owner/:name", handler.GetRepo) repos.Get("/api/repos/:host/:owner/:name", handler.GetRepo)
repos.Put("/api/repos/:host/:owner/:name", handler.PutRepo) repos.Put("/api/repos/:host/:owner/:name", handler.PutRepo)