Initial commit
This commit is contained in:
19
app/controllers/home_controller.go
Normal file
19
app/controllers/home_controller.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/unrolled/render"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func (server *Server) Home(w http.ResponseWriter, r *http.Request) {
|
||||
render := render.New(render.Options{
|
||||
Layout: "layout",
|
||||
Extensions: []string{".html", ".tmpl"},
|
||||
})
|
||||
|
||||
user := server.CurrentUser(w, r)
|
||||
|
||||
_ = render.HTML(w, http.StatusOK, "home", map[string]interface{}{
|
||||
"user": user,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user