Skip to content

Commit

Permalink
fix: Update Gopkg and add handleStatic function to main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
meabed committed Oct 3, 2018
1 parent 62d66fc commit 292c497
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
16 changes: 2 additions & 14 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ func serveHTTP(host string, port int) {
mux := http.NewServeMux()
for k, v := range routes {
mux.HandleFunc(k, v)
mux.Handle(`/`, http.FileServer(http.Dir(*staticPath)))
}

handleStatic(mux)

addr := fmt.Sprintf("%v:%d", host, port)
server := &http.Server{
Addr: addr,
Expand All @@ -111,3 +112,7 @@ func serveHTTP(host string, port int) {
err := server.ListenAndServe()
Logger.Error(err.Error())
}

func handleStatic(mux *http.ServeMux) {
mux.Handle(`/`, http.FileServer(http.Dir(*staticPath)))
}

0 comments on commit 292c497

Please sign in to comment.