diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2021-08-04 23:53:36 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2021-08-04 23:53:36 -0400 |
| commit | c202f2eca32e1ab2e313417168351df1c58ee062 (patch) | |
| tree | 6540629b337d2d769581baec26096ac0555f71f9 /cmd/web/main.go | |
| parent | 742938b00222c7ad57ad11eb24850d9202c2503d (diff) | |
| download | steam-export-c202f2eca32e1ab2e313417168351df1c58ee062.tar.gz steam-export-c202f2eca32e1ab2e313417168351df1c58ee062.tar.xz | |
More major changes. Web UI works. Downloading games works. Status works. extractFile needs work
Diffstat (limited to 'cmd/web/main.go')
| -rw-r--r-- | cmd/web/main.go | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/cmd/web/main.go b/cmd/web/main.go index 045f60a..20c3506 100644 --- a/cmd/web/main.go +++ b/cmd/web/main.go @@ -21,9 +21,10 @@ var ( Listen = ":8899" //go:embed static/* - embeddedStatic embed.FS - //go:embed templates/index.html - indexTemplate string + StaticFS embed.FS + //go:embed templates/* + TemplateFS embed.FS + //indexTemplate string ) func main() { @@ -36,6 +37,9 @@ func main() { fl.StringVar(&shareLink, "s", shareLink, "Share link, if blank make an educated guess") isDemo := fl.Bool("demo", false, "Whether or not to run in demo mode. You probably don't want this on.") + localFS := fl.String("fs", "", + "If not empty the local path to use instead of the "+ + "embedded templates and /static directory.") fl.Parse(os.Args[1:]) if *debug { @@ -47,12 +51,14 @@ func main() { Logger.Fatal(err) } + if *localFS != "" { + a.useLocalFS(*localFS) + } + if *isDemo { a.Demo = true } - go a.installer() - s := http.Server{Handler: a} for i := 0; i < 5; i++ { @@ -74,7 +80,8 @@ func main() { continue } - startBrowser("http://localhost" + Listen) + // Not using 'localhost' due to the way windows listens by default + startBrowser("http://127.0.0.1" + Listen) err = s.Serve(l) if err != nil { |
