diff --git a/initializers/assets.go b/initializers/assets.go index d5ef060..a4ff015 100644 --- a/initializers/assets.go +++ b/initializers/assets.go @@ -10,14 +10,8 @@ var ReleaseBasePath string = "/data/assets/" func CreateAssetsFolder(basePath string) { - if _, err := os.Stat(basePath + "images"); os.IsNotExist(err) { - if err := os.MkdirAll(basePath+"images", os.ModePerm); err != nil { - log.Fatal(err) - } - } - - if _, err := os.Stat(basePath + "videos"); os.IsNotExist(err) { - if err := os.MkdirAll(basePath+"videos", os.ModePerm); err != nil { + if _, err := os.Stat(basePath); os.IsNotExist(err) { + if err := os.MkdirAll(basePath, os.ModePerm); err != nil { log.Fatal(err) } } diff --git a/main.go b/main.go index 41b08c2..2586c8a 100644 --- a/main.go +++ b/main.go @@ -39,9 +39,9 @@ func main() { // Files if currentMode == "debug" { - api.Router.Static("assets", initializers.DebugBasePath+"/images") + api.Router.Static("assets", initializers.DebugBasePath) } else { - api.Router.Static("assets", initializers.ReleaseBasePath+"/images") + api.Router.Static("assets", initializers.ReleaseBasePath) } // Posts