Skip to content

Commit

Permalink
Merge pull request #117 from jadolg/add-fileserver-logs
Browse files Browse the repository at this point in the history
Add logs for the fileserver
  • Loading branch information
jadolg authored Jun 20, 2024
2 parents 9c038c6 + da1cbe6 commit 7c2590b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cmd/DockerImageSaveServer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package main
import (
"flag"
"fmt"
"github.com/prometheus/client_golang/prometheus/promhttp"
"log"
"net/http"

"github.com/prometheus/client_golang/prometheus/promhttp"

"github.com/gorilla/handlers"
"github.com/gorilla/mux"
)

Expand Down Expand Up @@ -39,7 +39,7 @@ func main() {
router.HandleFunc("/pull/{user}/{id}", PullImageHandler).Methods("GET")
router.HandleFunc("/save/{user}/{id}", SaveImageHandler).Methods("GET")
router.PathPrefix("/download/").Handler(http.StripPrefix("/download/",
http.FileServer(http.Dir(downloadsFolder))))
handlers.CombinedLoggingHandler(log.Writer(), http.FileServer(http.Dir(downloadsFolder)))))
router.HandleFunc("/healthcheck", HealthCheckHandler).Methods("GET")
router.Handle("/metrics", promhttp.Handler()).Methods("GET")
fmt.Println("Listening on port " + *port)
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ require (
golang.org/x/sys v0.18.0 // indirect
)

require github.com/sirupsen/logrus v1.9.3
require (
github.com/gorilla/handlers v1.5.2
github.com/sirupsen/logrus v1.9.3
)

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE=
github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms=
Expand Down

0 comments on commit 7c2590b

Please sign in to comment.