~sircmpwn/chartsrv

94c6289641ca95455c384691d699d885a7a16941 — Krystian Chachuła 1 year, 9 months ago ff0665c
Fix handling of absolute staticDir paths
1 files changed, 1 insertions(+), 3 deletions(-)

M main.go
M main.go => main.go +1 -3
@@ 10,7 10,6 @@ import (
	"net/http"
	"net/url"
	"os"
	"path/filepath"
	"sort"
	"strconv"
	"strings"


@@ 307,8 306,7 @@ func main() {
	}

	router.Get("/*", func(w http.ResponseWriter, r *http.Request) {
		workDir, _ := os.Getwd()
		fs := http.FileServer(http.Dir(filepath.Join(workDir, staticDir)))
		fs := http.FileServer(http.Dir(staticDir))
		fs.ServeHTTP(w, r)
	})