mirror of
https://github.com/Harry-zklcdc/go-proxy-bingai.git
synced 2024-05-03 14:25:13 +08:00
16 lines
402 B
Go
16 lines
402 B
Go
package api
|
|
|
|
import (
|
|
"adams549659584/go-proxy-bingai/common"
|
|
"adams549659584/go-proxy-bingai/web"
|
|
"net/http"
|
|
)
|
|
|
|
func WebStatic(w http.ResponseWriter, r *http.Request) {
|
|
if _, ok := web.WEB_PATH_MAP[r.URL.Path]; ok {
|
|
http.StripPrefix(common.PROXY_WEB_PREFIX_PATH, http.FileServer(web.GetWebFS())).ServeHTTP(w, r)
|
|
} else {
|
|
common.NewSingleHostReverseProxy(common.BING_URL).ServeHTTP(w, r)
|
|
}
|
|
}
|