diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..29ffdab --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1 @@ +FROM golang diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..b1f729e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,28 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/go +{ + "name": "Go", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/go:1-1.23-bookworm", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + "portsAttributes": { + "8080": { + "label": "Open resume page", + "onAutoForward": "notify" + } + }, + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "./run.sh" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/src/main.go b/src/main.go index 9e80ce0..a823149 100644 --- a/src/main.go +++ b/src/main.go @@ -24,10 +24,10 @@ func main() { func loggingMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // logrus.WithFields(logrus.Fields{ - // "requestURI": r.RequestURI, - // "X-Forwarded-For": r.Header.Get("X-Forwarded-For"), - // }).Info("incoming request") + logrus.WithFields(logrus.Fields{ + "requestURI": r.RequestURI, + "X-Forwarded-For": r.Header.Get("X-Forwarded-For"), + }).Info("incoming request") next.ServeHTTP(w, r) })