Commit f801e455824c615b926aba80e233f528ed8e5069

Authored by Georg Hopp
1 parent 6c3050fa

Add file serving on not api urls

Showing 1 changed file with 5 additions and 0 deletions
... ... @@ -28,6 +28,7 @@ import (
28 28 "context"
29 29 "io"
30 30 "net/http"
  31 + "os"
31 32 "strings"
32 33
33 34 "gitlab.weird-web-workers.org/golang/logger"
... ... @@ -80,6 +81,10 @@ func NewServer(addr string, log *logger.Logger) (server *Server) {
80 81 }
81 82
82 83 server.mux.Handle(
  84 + "/",
  85 + http.FileServer(http.Dir(os.Getenv("DOCUMENT_ROOT"))),
  86 + )
  87 + server.mux.Handle(
83 88 "/api/0.0.1/",
84 89 http.StripPrefix("/api/0.0.1/", &handler),
85 90 )
... ...
Please register or login to post a comment