go-proxy-bingai/main.go

28 lines
449 B
Go
Raw Normal View History

2023-05-03 11:30:10 +08:00
package main
import (
2023-05-04 11:29:40 +08:00
"adams549659584/go-proxy-bingai/api"
2023-05-03 11:30:10 +08:00
"log"
"net/http"
"time"
)
func main() {
2023-05-04 11:29:40 +08:00
http.HandleFunc("/sydney/ChatHub", api.ChatHub)
2023-05-03 11:30:10 +08:00
2023-05-04 11:29:40 +08:00
http.HandleFunc("/web/", api.WebStatic)
2023-05-03 11:30:10 +08:00
2023-05-04 11:29:40 +08:00
http.HandleFunc("/", api.Index)
2023-05-03 11:30:10 +08:00
2023-05-04 11:29:40 +08:00
addr := ":8080"
2023-05-03 11:30:10 +08:00
2023-05-04 11:29:40 +08:00
log.Println("Starting BingAI Proxy At " + addr)
2023-05-03 11:30:10 +08:00
srv := &http.Server{
2023-05-04 11:29:40 +08:00
Addr: addr,
2023-05-03 11:30:10 +08:00
WriteTimeout: 15 * time.Second,
ReadTimeout: 15 * time.Second,
}
log.Fatal(srv.ListenAndServe())
}