fix: bug
This commit is contained in:
parent
571f7e7c70
commit
f4106e156f
2 changed files with 4 additions and 10 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
4
main.go
4
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
|
||||
|
|
Loading…
Add table
Reference in a new issue