dev용 serverHTTP 추가

This commit is contained in:
2023-12-25 22:08:22 +09:00
parent 2e60fac840
commit da68071e97
2 changed files with 25 additions and 3 deletions

View File

@ -454,9 +454,11 @@ func (mg *Maingate) RegisterHandlers(ctx context.Context, serveMux *http.ServeMu
}
logger.Println("Service is registered :", mg.service().ServiceCode)
serveMux.HandleFunc(gocommon.MakeHttpHandlerPattern(prefix, mg.service().ServiceCode, "/"), func(w http.ResponseWriter, r *http.Request) {
mg.service().serveHTTP(w, r)
})
if *devflag {
serveMux.HandleFunc(gocommon.MakeHttpHandlerPattern(prefix, mg.service().ServiceCode, "/"), mg.service().serveHTTP_dev)
} else {
serveMux.HandleFunc(gocommon.MakeHttpHandlerPattern(prefix, mg.service().ServiceCode, "/"), mg.service().serveHTTP)
}
serveMux.HandleFunc(gocommon.MakeHttpHandlerPattern(prefix, "api/"), mg.api)
configraw, _ := json.Marshal(config)