feat: pull request generation
This commit is contained in:
@ -2,6 +2,7 @@ package setup
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"forge.cadoles.com/wpetit/clearcase/internal/config"
|
||||
"forge.cadoles.com/wpetit/clearcase/internal/http/handler/webui"
|
||||
@ -22,13 +23,27 @@ func NewWebUIHandlerFromConfig(ctx context.Context, conf *config.Config) (*webui
|
||||
|
||||
opts = append(opts, webui.WithMount("/auth/", authHandler))
|
||||
|
||||
// Configure index redirect
|
||||
|
||||
opts = append(opts, webui.WithMount("/", authMiddleware(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
http.Redirect(w, r, "/issue", http.StatusTemporaryRedirect)
|
||||
}))))
|
||||
|
||||
// Configure issue handler
|
||||
issueHandler, err := NewIssueHandlerFromConfig(ctx, conf)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not configure issue handler from config")
|
||||
}
|
||||
|
||||
opts = append(opts, webui.WithMount("/", authMiddleware(issueHandler)))
|
||||
opts = append(opts, webui.WithMount("/issue/", authMiddleware(issueHandler)))
|
||||
|
||||
// Configure pull request handler
|
||||
pullRequestHandler, err := NewPullRequestHandlerFromConfig(ctx, conf)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not configure pull request handler from config")
|
||||
}
|
||||
|
||||
opts = append(opts, webui.WithMount("/pullrequest/", authMiddleware(pullRequestHandler)))
|
||||
|
||||
// Configure common handler
|
||||
commonHandler, err := NewCommonHandlerFromConfig(ctx, conf)
|
||||
|
Reference in New Issue
Block a user