move handler into its own package

This commit is contained in:
6543 2022-11-12 18:44:04 +01:00
parent 8519bba527
commit 7acb60874e
No known key found for this signature in database
GPG Key ID: C99B82E40B027BAE
5 changed files with 6 additions and 5 deletions

View File

@ -20,6 +20,7 @@ import (
"codeberg.org/codeberg/pages/server/certificates"
"codeberg.org/codeberg/pages/server/database"
"codeberg.org/codeberg/pages/server/gitea"
"codeberg.org/codeberg/pages/server/handler"
)
// AllowedCorsDomains lists the domains for which Cross-Origin Resource Sharing is allowed.
@ -88,7 +89,7 @@ func Serve(ctx *cli.Context) error {
}
// Create handler based on settings
httpsHandler := server.Handler(mainDomainSuffix, rawDomain,
httpsHandler := handler.Handler(mainDomainSuffix, rawDomain,
giteaClient,
rawInfoPage,
BlacklistedPaths, allowedCorsDomains,

View File

@ -1,4 +1,4 @@
package server
package handler
import (
"fmt"

View File

@ -1,4 +1,4 @@
package server
package handler
import (
"net/http/httptest"

View File

@ -1,4 +1,4 @@
package server
package handler
import (
"strings"

View File

@ -1,4 +1,4 @@
package server
package handler
import (
"net/http"