nacos config

This commit is contained in:
eson 2023-09-22 11:35:40 +08:00
parent e925d8c684
commit 2d224c0d67

View File

@ -18,7 +18,6 @@ import (
"time"
"github.com/gorilla/websocket"
"github.com/zeromicro/go-zero/core/logx"
"gopkg.in/yaml.v2"
_ "fusenapi/utils/auth"
@ -105,16 +104,16 @@ func main() {
// 对/api开头的请求进行反向代理
proxy := httputil.NewSingleHostReverseProxy(apiURL)
proxy.ErrorHandler = func(res http.ResponseWriter, req *http.Request, err error) {
if err != nil {
// proxy.ErrorHandler = func(res http.ResponseWriter, req *http.Request, err error) {
// if err != nil {
// 在发生错误时进行处理
log.Println(res.Header())
logx.Info(err)
logx.Info(res.Header())
res.WriteHeader(http.StatusNotFound) // 返回404状态码
}
}
// // 在发生错误时进行处理
// log.Println(res.Header())
// logx.Info(err)
// logx.Info(res.Header())
// res.WriteHeader(http.StatusNotFound) // 返回404状态码
// }
// }
proxy.ServeHTTP(w, r)
return