mirror of https://github.com/gofiber/fiber.git
Fix panic on serving not-exists dir
parent
91ec284a42
commit
ce4f573564
|
@ -9,6 +9,7 @@ package fiber
|
|||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
@ -36,6 +37,11 @@ func (r *Fiber) Static(args ...string) {
|
|||
wildcard = true
|
||||
}
|
||||
|
||||
// Check if root exists
|
||||
if _, err := os.Lstat(root); err != nil {
|
||||
log.Fatal("Static: ", err)
|
||||
}
|
||||
|
||||
// Lets get all files from root
|
||||
files, _, err := getFiles(root)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue