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

33 lines
521 B
Go

package main
import (
"adams549659584/go-proxy-bingai/api"
"log"
"net/http"
"os"
"time"
)
func main() {
http.HandleFunc("/sydney/ChatHub", api.ChatHub)
http.HandleFunc("/web/", api.WebStatic)
http.HandleFunc("/", api.Index)
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
addr := ":" + port
log.Println("Starting BingAI Proxy At " + addr)
srv := &http.Server{
Addr: addr,
WriteTimeout: 15 * time.Second,
ReadTimeout: 15 * time.Second,
}
log.Fatal(srv.ListenAndServe())
}