diff --git a/cmd/web/handlers.go b/cmd/web/handlers.go index f1b22df..ef8b129 100644 --- a/cmd/web/handlers.go +++ b/cmd/web/handlers.go @@ -5,12 +5,12 @@ import ( ) func (app *application) home(writer http.ResponseWriter, request *http.Request) { - appLinks := getAppLinks(app.tier, app.host) + appLinks := getAppLinks(app.tier, app.domain) data := templateData{ AppLinks: appLinks, Tier: app.tier, - BaseUri: app.host, + BaseUri: app.domain, } app.render(writer, request, http.StatusOK, "home.tmpl.html", data) diff --git a/cmd/web/main.go b/cmd/web/main.go index 5ed21f4..3fb71d5 100644 --- a/cmd/web/main.go +++ b/cmd/web/main.go @@ -11,7 +11,7 @@ type application struct { logger *slog.Logger templateCache map[string]*template.Template tier string - host string + domain string } func main() { @@ -24,9 +24,9 @@ func main() { if len(tier) == 0 { tier = "starter" } - host := os.Getenv("HOST") - if len(host) == 0 { - logger.Error("Must specify host name.") + domain := os.Getenv("DOMAIN") + if len(domain) == 0 { + logger.Error("Must specify domain name.") os.Exit(1) } //Set up template cache @@ -40,7 +40,7 @@ func main() { logger: logger, templateCache: templateCache, tier: tier, - host: host, + domain: domain, } err = http.ListenAndServe(":8080", app.routes())