Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
fix serving static issues
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Dec 13, 2019
1 parent d448ca5 commit 25785a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion middleware/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ import (

// Static is a middleware that serves static assets.
func Static(root string, fs http.FileSystem) func(http.Handler) http.Handler {
if !strings.HasSuffix(root, "/") {
root = root + "/"
}

static := http.StripPrefix(
root+"/",
root,
http.FileServer(
fs,
),
Expand Down

0 comments on commit 25785a9

Please sign in to comment.