go-proxy-bingai/api/index.go
2023-05-08 12:07:55 +08:00

15 lines
306 B
Go

package api
import (
"adams549659584/go-proxy-bingai/common"
"net/http"
)
func Index(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/" {
http.Redirect(w, r, common.PROXY_WEB_PAGE_PATH, http.StatusFound)
} else {
common.NewSingleHostReverseProxy(common.BING_URL).ServeHTTP(w, r)
}
}