Skip to content

Commit

Permalink
Fix handling of absolute staticDir paths
Browse files Browse the repository at this point in the history
  • Loading branch information
krystiancha authored and ddevault committed Dec 16, 2021
1 parent ff0665c commit 94c6289
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"net/http"
"net/url"
"os"
"path/filepath"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -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)
})

Expand Down

0 comments on commit 94c6289

Please sign in to comment.