Embed fichiers statiques dans exécutable avec go embed #6

Merged
vlbeaudoin merged 2 commits from feature/embed into main 2023-11-29 17:25:31 -05:00
6 changed files with 11 additions and 1 deletions
Showing only changes of commit b68859f90b - Show all commits

View file

@ -27,7 +27,7 @@ WORKDIR /app
ADD contenu/ contenu/ ADD contenu/ contenu/
ADD static/ static/ ADD public/static/ static/
COPY --from=build /go/src/app/babillard /usr/bin/babillard COPY --from=build /go/src/app/babillard /usr/bin/babillard

10
public/embed.go Normal file
View file

@ -0,0 +1,10 @@
package public
import "embed"
//go:embed static/*
var embedFS embed.FS
func GetEmbedFS() embed.FS {
return embedFS
}