embed site files / form tweaks

This commit is contained in:
Hank
2024-07-19 23:19:41 -04:00
parent b19ac6a129
commit 16619e5c02
4 changed files with 24 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
_ "beszel/migrations"
"beszel/site"
"bytes"
"crypto/ed25519"
"encoding/json"
@@ -83,8 +84,10 @@ func main() {
e.Router.Any("/*", echo.WrapHandler(proxy))
e.Router.Any("/", echo.WrapHandler(proxy))
default:
e.Router.GET("/icons/*", apis.StaticDirectoryHandler(os.DirFS("./site/dist/icons"), false))
e.Router.Any("/*", apis.StaticDirectoryHandler(os.DirFS("./site/dist"), true))
assets, _ := site.Assets()
icons, _ := site.Icons()
e.Router.GET("/icons/*", apis.StaticDirectoryHandler(icons, false))
e.Router.Any("/*", apis.StaticDirectoryHandler(assets, true))
}
return nil
})