From 471aff5bc5b71f0d4d3c1e5e10d742804ee3ef56 Mon Sep 17 00:00:00 2001 From: Lukas Schulte Pelkum Date: Sat, 29 Jan 2022 01:28:54 +0100 Subject: [PATCH] Temporarily allow customization of the frontend path (workaround for #36, #37) --- internal/static/static.go | 4 ++++ internal/web/web.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/static/static.go b/internal/static/static.go index 734e85e..e5b2528 100644 --- a/internal/static/static.go +++ b/internal/static/static.go @@ -4,4 +4,8 @@ package static var ( Version = "dev" EnvironmentVariablePrefix = "PASTY_" + + // TempFrontendPath defines the path where pasty loads the web frontend from; it will be removed any time soon + // TODO: Remove this when issue #37 is fixed + TempFrontendPath = "./web" ) diff --git a/internal/web/web.go b/internal/web/web.go index 3c509b0..047c958 100644 --- a/internal/web/web.go +++ b/internal/web/web.go @@ -106,7 +106,7 @@ func Serve() error { func frontendHandler() fasthttp.RequestHandler { // Create the file server fs := &fasthttp.FS{ - Root: "./web", + Root: static.TempFrontendPath, IndexNames: []string{"index.html"}, CacheDuration: 0, }