mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-05 08:27:05 +02:00
initial support of homepage labels
This commit is contained in:
@@ -17,6 +17,7 @@ const (
|
||||
ListMiddlewares = "middlewares"
|
||||
ListMiddlewareTrace = "middleware_trace"
|
||||
ListMatchDomains = "match_domains"
|
||||
ListHomepageConfig = "homepage_config"
|
||||
)
|
||||
|
||||
func List(cfg *config.Config, w http.ResponseWriter, r *http.Request) {
|
||||
@@ -36,6 +37,8 @@ func List(cfg *config.Config, w http.ResponseWriter, r *http.Request) {
|
||||
listMiddlewareTrace(w, r)
|
||||
case ListMatchDomains:
|
||||
listMatchDomains(cfg, w, r)
|
||||
case ListHomepageConfig:
|
||||
listHomepageConfig(cfg, w, r)
|
||||
default:
|
||||
U.HandleErr(w, r, U.ErrInvalidKey("what"), http.StatusBadRequest)
|
||||
}
|
||||
@@ -78,3 +81,7 @@ func listMiddlewares(w http.ResponseWriter, r *http.Request) {
|
||||
func listMatchDomains(cfg *config.Config, w http.ResponseWriter, r *http.Request) {
|
||||
U.HandleErr(w, r, U.RespondJson(w, cfg.Value().MatchDomains))
|
||||
}
|
||||
|
||||
func listHomepageConfig(cfg *config.Config, w http.ResponseWriter, r *http.Request) {
|
||||
U.HandleErr(w, r, U.RespondJson(w, cfg.HomepageConfig()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user