Enhance joinURL and return error on gitea client on start instead while running (#88)

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/88
This commit is contained in:
6543 2022-06-13 20:07:32 +02:00
parent 913f762eb0
commit cc32bab31f
4 changed files with 35 additions and 17 deletions

View file

@ -82,7 +82,10 @@ func Serve(ctx *cli.Context) error {
// TODO: make this an MRU cache with a size limit
fileResponseCache := cache.NewKeyValueCache()
giteaClient := gitea.NewClient(giteaRoot, giteaAPIToken)
giteaClient, err := gitea.NewClient(giteaRoot, giteaAPIToken)
if err != nil {
return fmt.Errorf("could not create new gitea client: %v", err)
}
// Create handler based on settings
handler := server.Handler(mainDomainSuffix, []byte(rawDomain),