diff options
-rw-r--r-- | cmd/server/main.go | 7 | ||||
-rw-r--r-- | internal/server/server.go | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go index 1388463..d73e19f 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -25,6 +25,13 @@ func main() { } log.Configure(!runtimeConfig.Development) + tmpdir, err := os.MkdirTemp("", "website") + if err != nil { + log.Fatal("could not create temporary directory", "error", err) + } + defer os.RemoveAll(tmpdir) + runtimeConfig.Root = tmpdir + sv, err := server.New(&runtimeConfig) if err != nil { log.Error("could not create server", "error", err) diff --git a/internal/server/server.go b/internal/server/server.go index 54c4569..05b1d2a 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -103,13 +103,6 @@ func New(runtimeConfig *Config) (*Server, error) { return nil, err } runtimeConfig.Root = "website" - } else { - tmpdir, err := os.MkdirTemp("", "website") - if err != nil { - return nil, err - } - defer os.RemoveAll(tmpdir) - runtimeConfig.Root = tmpdir } config, err := cfg.GetConfig() |