Temporarily allow customization of the frontend path (workaround for #36, #37)

This commit is contained in:
Lukas Schulte Pelkum 2022-01-29 01:28:54 +01:00
parent 7a99f85060
commit 471aff5bc5
No known key found for this signature in database
GPG Key ID: 408DA7CA81DB885C
2 changed files with 5 additions and 1 deletions

View File

@ -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"
)

View File

@ -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,
}