BOHE commited on
Commit
772cf93
·
1 Parent(s): 7687ace
Files changed (1) hide show
  1. start.go +2 -2
start.go CHANGED
@@ -38,10 +38,10 @@ func run() error {
38
  http.HandleFunc("/api/", api.Handler)
39
 
40
  port := fmt.Sprintf(":%d", config.Port)
41
- fmt.Printf("Server is running on http://localhost%s\n", port)
42
 
43
  // 启动服务器
44
- if err := http.ListenAndServe(port, nil); err != nil {
45
  return fmt.Errorf("启动服务器失败: %w", err)
46
  }
47
  return nil
 
38
  http.HandleFunc("/api/", 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)
42
 
43
  // 启动服务器
44
+ if err := http.ListenAndServe("0.0.0.0"+port, nil); err != nil {
45
  return fmt.Errorf("启动服务器失败: %w", err)
46
  }
47
  return nil