aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/main.go b/main.go
index 4527825..8eca6a7 100644
--- a/main.go
+++ b/main.go
@@ -6,6 +6,7 @@ package main
import (
"errors"
"flag"
+ "io/fs"
"log"
"log/slog"
"net"
@@ -26,6 +27,16 @@ func main() {
s := server{}
+ s.sourceHandler = http.StripPrefix(
+ "/-/source/",
+ http.FileServer(http.FS(embeddedSourceFS)),
+ )
+ staticFS, err := fs.Sub(embeddedResourcesFS, "static")
+ if err != nil {
+ panic(err)
+ }
+ s.staticHandler = http.StripPrefix("/-/static/", http.FileServer(http.FS(staticFS)))
+
if err := s.loadConfig(*configPath); err != nil {
slog.Error("loading configuration", "error", err)
os.Exit(1)