|
|
|
@@ -28,6 +28,7 @@ import ( |
|
|
|
// ── Config ──────────────────────────────────────────────────────────────────── |
|
|
|
|
|
|
|
type Config struct { |
|
|
|
Host string `yaml:"host"` |
|
|
|
Port int `yaml:"port"` |
|
|
|
WinampPath string `yaml:"winamp_path"` |
|
|
|
KillListFile string `yaml:"killist_file"` |
|
|
|
@@ -36,7 +37,8 @@ type Config struct { |
|
|
|
|
|
|
|
func loadConfig(path string) (Config, error) { |
|
|
|
cfg := Config{ |
|
|
|
Port: 8080, |
|
|
|
Host: "0.0.0.0", |
|
|
|
Port: 8889, |
|
|
|
KillListFile: "killist.dat", |
|
|
|
ResumeFile: "resume.dat", |
|
|
|
} |
|
|
|
@@ -83,8 +85,8 @@ func (s *Server) Run() error { |
|
|
|
go s.restoreResume() |
|
|
|
go s.killChecker() |
|
|
|
|
|
|
|
addr := fmt.Sprintf(":%d", s.cfg.Port) |
|
|
|
log.Printf("roadamp listening on http://localhost%s", addr) |
|
|
|
addr := fmt.Sprintf("%s:%d", s.cfg.Host, s.cfg.Port) |
|
|
|
log.Printf("roadamp listening on http://%s", addr) |
|
|
|
return http.ListenAndServe(addr, s.mux) |
|
|
|
} |
|
|
|
|
|
|
|
|