From 0898213aa80bc70a999f7950931c002d2ba0f17e Mon Sep 17 00:00:00 2001 From: mountain Date: Wed, 28 Jun 2023 16:45:18 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/maingate.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/maingate.go b/core/maingate.go index e57657f..37111c7 100644 --- a/core/maingate.go +++ b/core/maingate.go @@ -534,10 +534,14 @@ func (mg *Maingate) RegisterHandlers(ctx context.Context, serveMux *http.ServeMu } cfsx := http.FileServer(http.Dir("console")) - serveMux.Handle(prefix+"/console/", http.StripPrefix(prefix+"/console/", cfsx)) + pattern := gocommon.MakeHttpHandlerPattern(prefix, "console", "/") + serveMux.Handle(pattern, http.StripPrefix(pattern, cfsx)) + logger.Println("maingate console registered :", pattern) staticfs := http.FileServer(http.Dir("static")) - serveMux.Handle(prefix+"/static/", http.StripPrefix(prefix+"/static/", staticfs)) + pattern = gocommon.MakeHttpHandlerPattern(prefix, "static", "/") + serveMux.Handle(pattern, http.StripPrefix(pattern, staticfs)) + logger.Println("maingate static registered :", pattern) serveMux.HandleFunc(gocommon.MakeHttpHandlerPattern(prefix, "request_login_url", AuthPlatformGoogle), mg.platform_google_get_login_url) serveMux.HandleFunc(gocommon.MakeHttpHandlerPattern(prefix, "authorize", AuthPlatformGoogle), mg.platform_google_authorize)