Browse Source

Add file serving on not api urls

master
Georg Hopp 7 years ago
parent
commit
f801e45582
Signed by: ghopp GPG Key ID: 4C5D226768784538
  1. 5
      server.go

5
server.go

@ -28,6 +28,7 @@ import (
"context" "context"
"io" "io"
"net/http" "net/http"
"os"
"strings" "strings"
"gitlab.weird-web-workers.org/golang/logger" "gitlab.weird-web-workers.org/golang/logger"
@ -79,6 +80,10 @@ func NewServer(addr string, log *logger.Logger) (server *Server) {
ctx: context.Background(), ctx: context.Background(),
} }
server.mux.Handle(
"/",
http.FileServer(http.Dir(os.Getenv("DOCUMENT_ROOT"))),
)
server.mux.Handle( server.mux.Handle(
"/api/0.0.1/", "/api/0.0.1/",
http.StripPrefix("/api/0.0.1/", &handler), http.StripPrefix("/api/0.0.1/", &handler),

Loading…
Cancel
Save