From 3bbb49e74b8eab7714c2df1162d086f6d731e1e8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 10 May 2024 23:05:24 +0200 Subject: build: optionally embed frontend files --- internal/server/server.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'internal/server/server.go') diff --git a/internal/server/server.go b/internal/server/server.go index a9df405..0474e39 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -16,6 +16,7 @@ import ( "strconv" "time" + "searchix/frontend" cfg "searchix/internal/config" "searchix/internal/importer" "searchix/internal/options" @@ -243,10 +244,7 @@ func New(runtimeConfig *Config) (*Server, error) { } }) - mux.Handle( - "/static/", - http.StripPrefix("/static/", http.FileServer(http.Dir("frontend/static"))), - ) + mux.Handle("/static/", http.FileServer(http.FS(frontend.Files))) if runtimeConfig.LiveReload { applyDevModeOverrides(config) -- cgit 1.4.1