about summary refs log tree commit diff stats
path: root/internal/server/server.go
diff options
context:
space:
mode:
authorAlan Pearce2024-05-10 23:05:24 +0200
committerAlan Pearce2024-05-10 23:05:24 +0200
commit3bbb49e74b8eab7714c2df1162d086f6d731e1e8 (patch)
treee655ba63d3eca271aad33107796d49400ed11215 /internal/server/server.go
parent00eb7541d54e76f8b55fe499d6955786927b207b (diff)
downloadsearchix-3bbb49e74b8eab7714c2df1162d086f6d731e1e8.tar.lz
searchix-3bbb49e74b8eab7714c2df1162d086f6d731e1e8.tar.zst
searchix-3bbb49e74b8eab7714c2df1162d086f6d731e1e8.zip
build: optionally embed frontend files
Diffstat (limited to 'internal/server/server.go')
-rw-r--r--internal/server/server.go6
1 files changed, 2 insertions, 4 deletions
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)