diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2021-03-19 00:55:38 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2021-03-19 00:55:38 -0400 |
| commit | 219e47ae2a10ae6aca42e58abd084a69641ec613 (patch) | |
| tree | ea949ff8a1d60e93f1031a56c692c93965ee69c2 /cmd/web/app.go | |
| parent | cd2a6a963c3841fcd83e5e2910dfa4d9241c97f9 (diff) | |
| download | steam-export-dev-mar-2021.tar.gz steam-export-dev-mar-2021.tar.xz | |
devdev-mar-2021
Diffstat (limited to 'cmd/web/app.go')
| -rw-r--r-- | cmd/web/app.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cmd/web/app.go b/cmd/web/app.go index 8f6df89..2c19545 100644 --- a/cmd/web/app.go +++ b/cmd/web/app.go @@ -1,6 +1,9 @@ package main import ( + "os" + "path/filepath" + "sync" "html/template" "time" @@ -34,6 +37,16 @@ type App struct { download chan string } +var getWd string +func (a *App) MuhTemplates() *template.Template { + if getWd == "" { + getWd, _ = os.Getwd() + } + + return template.Must(template.ParseFiles( + filepath.Join(getWd, "cmd/web/templates/index.html"))) +} + func NewApp(libPath string) (*App, error) { lib, err := steam.NewLibrary(libPath) if err != nil { |
