aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-06-11 20:59:02 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-06-11 21:00:12 +0200
commit7ff4cac4fc23060a56b9c33a3453c2d26629b699 (patch)
tree0fb0dcc9b11b27d54395d425e4cb3049fba0c398 /main.go
parent2fcc394c53f995750b52ad06153041f61f0a0c55 (diff)
downloadcerrado-0.0.1.tar.gz
cerrado-0.0.1.tar.bz2
cerrado-0.0.1.zip
feat: Add server listen configurationv0.0.1
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/main.go b/main.go
index eedff5e..18b73ff 100644
--- a/main.go
+++ b/main.go
@@ -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)