nacos config
This commit is contained in:
parent
e925d8c684
commit
2d224c0d67
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user