add daemon config

This commit is contained in:
2025-11-02 14:35:20 +01:00
parent 6e4452ddb9
commit c252c9a934
4 changed files with 103 additions and 7 deletions

View File

@@ -25,7 +25,7 @@ type (
}
)
func NewServer(data *storage.Repository, scheduler *cronruntime.Scheduler, port int) *HTTPServer {
func NewServer(data *storage.Repository, scheduler *cronruntime.Scheduler, addr string, port int) *HTTPServer {
s := &HTTPServer{
data: data,
scheduler: scheduler,
@@ -57,7 +57,7 @@ func NewServer(data *storage.Repository, scheduler *cronruntime.Scheduler, port
})
})
s.Server = &http.Server{
Addr: fmt.Sprintf(":%d", port),
Addr: fmt.Sprintf("%s:%d", addr, port),
Handler: router,
}
return s