summaryrefslogtreecommitdiff
path: root/cmd/tfstate
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cmd/tfstated/main.go3
-rw-r--r--cmd/tfstated/routes.go1
2 files changed, 3 insertions, 1 deletions
diff --git a/cmd/tfstated/main.go b/cmd/tfstated/main.go
index 61248bc..cf93976 100644
--- a/cmd/tfstated/main.go
+++ b/cmd/tfstated/main.go
@@ -14,6 +14,7 @@ import (
"time"
"git.adyxax.org/adyxax/tfstated/pkg/database"
+ "git.adyxax.org/adyxax/tfstated/pkg/logger"
)
type Config struct {
@@ -49,7 +50,7 @@ func run(
httpServer := &http.Server{
Addr: net.JoinHostPort(config.Host, config.Port),
- Handler: mux,
+ Handler: logger.Middleware(mux),
}
go func() {
log.Printf("listening on %s\n", httpServer.Addr)
diff --git a/cmd/tfstated/routes.go b/cmd/tfstated/routes.go
index 32ab111..853970a 100644
--- a/cmd/tfstated/routes.go
+++ b/cmd/tfstated/routes.go
@@ -11,6 +11,7 @@ func addRoutes(
db *database.DB,
) {
mux.Handle("GET /healthz", handleHealthz())
+
mux.Handle("GET /", handleGet(db))
mux.Handle("POST /", handlePost(db))
}