Spaces:
Configuration error
Configuration error
BOHE
commited on
Commit
·
d851ae1
1
Parent(s):
772cf93
xiufu
Browse files
start.go
CHANGED
|
@@ -29,13 +29,13 @@ func run() error {
|
|
| 29 |
if err != nil {
|
| 30 |
return fmt.Errorf("初始化代理失败: %w", err)
|
| 31 |
}
|
| 32 |
-
|
| 33 |
// 注册代理处理器
|
| 34 |
http.Handle("/proxy/", http.StripPrefix("/proxy", proxy))
|
| 35 |
}
|
| 36 |
|
| 37 |
-
//
|
| 38 |
-
http.HandleFunc("/
|
| 39 |
|
| 40 |
port := fmt.Sprintf(":%d", config.Port)
|
| 41 |
fmt.Printf("Server is running on http://0.0.0.0%s\n", port)
|
|
|
|
| 29 |
if err != nil {
|
| 30 |
return fmt.Errorf("初始化代理失败: %w", err)
|
| 31 |
}
|
| 32 |
+
|
| 33 |
// 注册代理处理器
|
| 34 |
http.Handle("/proxy/", http.StripPrefix("/proxy", proxy))
|
| 35 |
}
|
| 36 |
|
| 37 |
+
// 注册API处理器到根路径
|
| 38 |
+
http.HandleFunc("/", api.Handler)
|
| 39 |
|
| 40 |
port := fmt.Sprintf(":%d", config.Port)
|
| 41 |
fmt.Printf("Server is running on http://0.0.0.0%s\n", port)
|