maintenance 바로 반영 안되는 문제 수정

This commit is contained in:
2024-02-04 15:23:33 +09:00
parent 45e7169c3a
commit a3b4ac47b8
2 changed files with 33 additions and 7 deletions

View File

@ -457,9 +457,15 @@ func (mg *Maingate) RegisterHandlers(ctx context.Context, serveMux *http.ServeMu
logger.Println("Service is registered :", mg.service().ServiceCode)
if *devflag {
serveMux.HandleFunc(gocommon.MakeHttpHandlerPattern(prefix, mg.service().ServiceCode, "/"), mg.service().serveHTTP_dev)
serveMux.HandleFunc(gocommon.MakeHttpHandlerPattern(prefix, mg.service().ServiceCode, "/"), func(w http.ResponseWriter, r *http.Request) {
// mg.service()를 요청마다 불러야 함
mg.service().serveHTTP_dev(w, r)
})
} else {
serveMux.HandleFunc(gocommon.MakeHttpHandlerPattern(prefix, mg.service().ServiceCode, "/"), mg.service().serveHTTP)
serveMux.HandleFunc(gocommon.MakeHttpHandlerPattern(prefix, mg.service().ServiceCode, "/"), func(w http.ResponseWriter, r *http.Request) {
// mg.service()를 요청마다 불러야 함
mg.service().serveHTTP(w, r)
})
}
serveMux.HandleFunc(gocommon.MakeHttpHandlerPattern(prefix, "api/"), mg.api)