Skip to content

Commit 6f45eed

Browse files
committed
Add devcontainer
1 parent f86e962 commit 6f45eed

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM golang

.devcontainer/devcontainer.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/go
3+
{
4+
"name": "Go",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/go:1-1.23-bookworm",
7+
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
// "features": {},
10+
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
13+
"portsAttributes": {
14+
"8080": {
15+
"label": "Open resume page",
16+
"onAutoForward": "notify"
17+
}
18+
},
19+
20+
// Use 'postCreateCommand' to run commands after the container is created.
21+
"postCreateCommand": "./run.sh"
22+
23+
// Configure tool-specific properties.
24+
// "customizations": {},
25+
26+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
27+
// "remoteUser": "root"
28+
}

src/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ func main() {
2424
func loggingMiddleware(next http.Handler) http.Handler {
2525
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
2626

27-
// logrus.WithFields(logrus.Fields{
28-
// "requestURI": r.RequestURI,
29-
// "X-Forwarded-For": r.Header.Get("X-Forwarded-For"),
30-
// }).Info("incoming request")
27+
logrus.WithFields(logrus.Fields{
28+
"requestURI": r.RequestURI,
29+
"X-Forwarded-For": r.Header.Get("X-Forwarded-For"),
30+
}).Info("incoming request")
3131

3232
next.ServeHTTP(w, r)
3333
})

0 commit comments

Comments
 (0)