This commit is contained in:
Nabil Ould Hamou 2024-03-02 00:04:00 +01:00
parent 571f7e7c70
commit f4106e156f
No known key found for this signature in database
GPG key ID: 2B1AE73E9B6014EF
2 changed files with 4 additions and 10 deletions

View file

@ -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)
}
}

View file

@ -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