Browse Source

Update to use static site

hkremer/rebranding
Gregory Rudolph 4 years ago
parent
commit
988acb4a90
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 5
      site-api.go

5
site-api.go

@ -56,10 +56,11 @@ func pageBuilder(r *http.Request, pageName string) string { @@ -56,10 +56,11 @@ func pageBuilder(r *http.Request, pageName string) string {
func greetUser(w http.ResponseWriter, r *http.Request) {
defer log.PanicSafe()
log.LogInfo(fmt.Sprintf("%s called greetUser", getSessionIdentifier(r)))
loggedIn, username := detectUser(r, "greetUser")
loggedIn, _ := detectUser(r, "Homepage")
if loggedIn {
fmt.Fprintf(w, strings.Replace(pageBuilder(r, "loggedIn"), "$USER", username, -1))
bodyTemplate, _ := ioutil.ReadFile("./static/index.html")
fmt.Fprintf(w, string(bodyTemplate))
} else {
fmt.Fprintf(w, pageBuilder(r, "home"))
}

Loading…
Cancel
Save