diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-06-11 20:59:02 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-06-11 21:00:12 +0200 |
commit | 7ff4cac4fc23060a56b9c33a3453c2d26629b699 (patch) | |
tree | 0fb0dcc9b11b27d54395d425e4cb3049fba0c398 /main.go | |
parent | 2fcc394c53f995750b52ad06153041f61f0a0c55 (diff) | |
download | cerrado-7ff4cac4fc23060a56b9c33a3453c2d26629b699.tar.gz cerrado-7ff4cac4fc23060a56b9c33a3453c2d26629b699.tar.bz2 cerrado-7ff4cac4fc23060a56b9c33a3453c2d26629b699.zip |
feat: Add server listen configurationv0.0.1
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -4,7 +4,6 @@ import ( "context" "flag" "log/slog" - "net/http" "os" "os/signal" "time" @@ -16,7 +15,6 @@ import ( ) func main() { - ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill) defer stop() if err := run(ctx); err != nil { @@ -27,7 +25,7 @@ func main() { func run(ctx context.Context) error { var ( - configPath = flag.String("config", "config.example.scfg", "File path for the configuration file") + configPath = flag.String("config", "/etc/cerrado.scfg", "File path for the configuration file") ) flag.Parse() @@ -46,7 +44,7 @@ func run(ctx context.Context) error { return err } - serverTask := worker.NewServerTask(&http.Server{Handler: handler, Addr: "0.0.0.0:8080"}) + serverTask := worker.NewServerTask(configRepo.GetListenAddr(), handler) pool := worker.NewTaskPool() pool.AddTask("http-server", 5*time.Second, serverTask) |