The primary model users will interact with is now Websites, which will have a single guestbook associated with it (though this is not enforced by the database).
		
			
				
	
	
		
			16 lines
		
	
	
		
			321 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			321 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package main
 | |
| 
 | |
| import (
 | |
| 	"net/http"
 | |
| 
 | |
| 	"git.32bit.cafe/32bitcafe/guestbook/ui/views"
 | |
| )
 | |
| 
 | |
| func (app *application) home(w http.ResponseWriter, r *http.Request) {
 | |
| 	if app.isAuthenticated(r) {
 | |
| 		http.Redirect(w, r, "/websites", http.StatusSeeOther)
 | |
| 		return
 | |
| 	}
 | |
| 	views.Home("Home", app.newCommonData(r)).Render(r.Context(), w)
 | |
| }
 |