Serve compiled front from the same application
also add embedded build for production
This commit is contained in:
19
front/frontend_embed.go
Normal file
19
front/frontend_embed.go
Normal file
@@ -0,0 +1,19 @@
|
||||
//go:build embed
|
||||
|
||||
package front
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
)
|
||||
|
||||
//go:embed dist
|
||||
var frontend embed.FS
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
Frontend, err = fs.Sub(frontend, "dist")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user