aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/main.go
diff options
context:
space:
mode:
authorMitchell <mitch@riedstra.dev>2021-03-20 01:37:03 -0400
committerMitchell <mitch@riedstra.dev>2021-03-20 01:37:03 -0400
commitd047c36dd09b6169bf27c244196e99bb5df54c3a (patch)
tree5103e1951bd58bbef54c90a13c199e8d1d866492 /cmd/web/main.go
parent0e62a3b46b25e7c101b14ed44235f3c276982fc0 (diff)
downloadsteam-export-d047c36dd09b6169bf27c244196e99bb5df54c3a.tar.gz
steam-export-d047c36dd09b6169bf27c244196e99bb5df54c3a.tar.xz
Update documentation. Remove all traces of chdir from the steam library. Remove most linter complaints.
Diffstat (limited to 'cmd/web/main.go')
-rw-r--r--cmd/web/main.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/cmd/web/main.go b/cmd/web/main.go
index da0bebd..7475478 100644
--- a/cmd/web/main.go
+++ b/cmd/web/main.go
@@ -14,9 +14,12 @@ import (
)
var (
+ // Version is overridden by the build script
Version = "Development"
- Logger = log.New(os.Stderr, "", log.LstdFlags)
- Listen = ":8899"
+ // Logger default logging to stderr
+ Logger = log.New(os.Stderr, "", log.LstdFlags)
+ // Listen address for the webserver
+ Listen = ":8899"
//go:embed static/*
embeddedStatic embed.FS
@@ -48,7 +51,7 @@ func main() {
r.Handle("/setLib", UnauthorizedIfNotLocal(http.HandlerFunc(a.HandleSetLib)))
r.Handle("/delete", UnauthorizedIfNotLocal(http.HandlerFunc(a.HandleDelete)))
r.Handle("/install", UnauthorizedIfNotLocal(http.HandlerFunc(a.HandleInstall)))
- r.HandleFunc("/steam-export-web.exe", serveSelf)
+ r.HandleFunc("/steam-export-web.exe", ServeSelf)
r.HandleFunc("/download/{game}", a.HandleDownload)
r.Handle("/status", UnauthorizedIfNotLocal(http.HandlerFunc(a.HandleStats)))
r.PathPrefix("/static").Handler(
@@ -72,7 +75,7 @@ func main() {
if err != nil {
panic(err)
}
- port += 1
+ port++
Listen = fmt.Sprintf("%s:%d", parts[0], port)