Skip to content

Commit 4161dee

Browse files
committed
chore: Remove log of /api/healthcheck
1 parent 048121c commit 4161dee

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ RUN go mod download
99

1010
COPY . .
1111
RUN go build -a -ldflags "-w -s \
12-
-X github.com/voidcontests/api/internal/version.GIT_COMMIT=$(git rev-parse --short HEAD) \
13-
-X github.com/voidcontests/api/internal/version.GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" \
12+
-X github.com/voidcontests/api/internal/version.Commit=$(git rev-parse --short HEAD) \
13+
-X github.com/voidcontests/api/internal/version.Branch=$(git rev-parse --abbrev-ref HEAD)" \
1414
-o build/api ./cmd/api
1515

1616
# lightweight docker container with binaries only

internal/version/version.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package version
22

33
import "log/slog"
44

5-
var GIT_COMMIT string
6-
var GIT_BRANCH string
5+
var Commit string
6+
var Branch string
77

8-
var CommitAttr = slog.Attr{Key: "commit", Value: slog.StringValue(GIT_COMMIT)}
9-
var BranchAttr = slog.Attr{Key: "branch", Value: slog.StringValue(GIT_BRANCH)}
8+
var CommitAttr = slog.Attr{Key: "commit", Value: slog.StringValue(Commit)}
9+
var BranchAttr = slog.Attr{Key: "branch", Value: slog.StringValue(Branch)}

pkg/requestlog/requestlog.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
func Completed(next echo.HandlerFunc) echo.HandlerFunc {
1414
return func(c echo.Context) error {
15-
if c.Request().Method == "OPTIONS" {
15+
if c.Request().Method == "OPTIONS" || c.Path() == "/api/healthcheck" {
1616
return next(c)
1717
}
1818

0 commit comments

Comments
 (0)