企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
~~~ package main import ( "fmt" "net/http" ) func main() { http.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { // 302 Found 重定向到新的URL http.Redirect(w, r, "/destination", http.StatusFound) }) http.HandleFunc("/destination", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "This is the destination page.") }) fmt.Println("Server is running on :8080") http.ListenAndServe(":8080", nil) } ~~~