mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 09:05:30 +00:00
-unused img path
This commit is contained in:
11
app/kgpz.go
11
app/kgpz.go
@@ -25,7 +25,6 @@ import (
|
||||
// It is meant to be constructed once and then used as a singleton.
|
||||
|
||||
const (
|
||||
IMG_PREFIX = "/img/"
|
||||
PICTURES_PREFIX = "/static/pictures/"
|
||||
|
||||
EDITION_URL = "/edition/"
|
||||
@@ -89,16 +88,6 @@ func NewKGPZ(config *providers.ConfigProvider) (*KGPZ, error) {
|
||||
}
|
||||
|
||||
func (k *KGPZ) Pre(srv *fiber.App) error {
|
||||
// Check if folder exists and if yes, serve image files from it
|
||||
if _, err := os.Stat(k.Config.Config.ImgPath); err == nil {
|
||||
fs := os.DirFS(k.Config.Config.ImgPath)
|
||||
srv.Use(IMG_PREFIX, compress.New(compress.Config{
|
||||
Level: compress.LevelBestSpeed,
|
||||
}), etag.New(), helpers.StaticHandler(&fs))
|
||||
} else {
|
||||
logging.Info("Image folder not found. Skipping image serving.")
|
||||
}
|
||||
|
||||
// Serve newspaper pictures from pictures directory
|
||||
picturesPath := k.Config.Config.PicturesPath
|
||||
if _, err := os.Stat(picturesPath); err == nil {
|
||||
|
||||
Reference in New Issue
Block a user