forked from hinterland/hearth
feat: vendor gitea 1.16.2
This commit is contained in:
@@ -13,21 +13,28 @@ import (
|
||||
"code.gitea.io/gitea/modules/web"
|
||||
"code.gitea.io/gitea/routers/common"
|
||||
"code.gitea.io/gitea/routers/web/healthcheck"
|
||||
"code.gitea.io/gitea/routers/web/misc"
|
||||
"code.gitea.io/gitea/services/forms"
|
||||
)
|
||||
|
||||
// Routes registers the installation routes
|
||||
func Routes() *web.Router {
|
||||
base := web.NewRouter()
|
||||
base.Use(common.ProtocolMiddlewares()...)
|
||||
base.BeforeRouting(common.ProtocolMiddlewares()...)
|
||||
|
||||
base.Methods("GET, HEAD", "/assets/*", public.FileHandlerFunc())
|
||||
|
||||
r := web.NewRouter()
|
||||
r.Use(common.Sessioner(), Contexter())
|
||||
r.AfterRouting(common.MustInitSessioner(), installContexter())
|
||||
|
||||
r.Get("/", Install) // it must be on the root, because the "install.js" use the window.location to replace the "localhost" AppURL
|
||||
r.Post("/", web.Bind(forms.InstallForm{}), SubmitInstall)
|
||||
r.Get("/post-install", InstallDone)
|
||||
|
||||
r.Get("/-/web-theme/list", misc.WebThemeList)
|
||||
r.Post("/-/web-theme/apply", misc.WebThemeApply)
|
||||
r.Get("/api/healthz", healthcheck.Check)
|
||||
|
||||
r.NotFound(installNotFound)
|
||||
|
||||
base.Mount("", r)
|
||||
|
||||
Reference in New Issue
Block a user