slighty changed the backend rewrite for more performance and less buggy logging
This commit is contained in:
@@ -136,13 +136,15 @@ func init() {
|
|||||||
app.Use(func(c *fiber.Ctx) error {
|
app.Use(func(c *fiber.Ctx) error {
|
||||||
path := c.Path()
|
path := c.Path()
|
||||||
|
|
||||||
|
// if it is for the api, don't try to add the html extension
|
||||||
|
if path[1:4] != "dev" {
|
||||||
|
// check, wether a html-file exists for the path
|
||||||
if _, err := os.Stat(filepath.Join("html", path)); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(filepath.Join("html", path)); errors.Is(err, os.ErrNotExist) {
|
||||||
htmlPath := path + ".html"
|
htmlPath := path + ".html"
|
||||||
|
|
||||||
if _, err := os.Stat(filepath.Join("html", htmlPath)); err == nil {
|
if _, err := os.Stat(filepath.Join("html", htmlPath)); err == nil {
|
||||||
c.Path(htmlPath)
|
c.Path(htmlPath)
|
||||||
} else {
|
}
|
||||||
logger.Debug().Msgf("%q", err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user