root page, new layout
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"teletype_softwares/domain"
|
||||
"teletype_softwares/lib/template_utils"
|
||||
)
|
||||
|
||||
type RootController struct {
|
||||
service domain.SoftwareServiceInterface
|
||||
}
|
||||
|
||||
func NewRootController() *RootController {
|
||||
return &RootController{}
|
||||
}
|
||||
|
||||
func (c *RootController) index(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
tmpl, err := template_utils.GetTemplate("root_index", "http/views/shared/layout.html", "http/views/root/index.html")
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
tmpl.Execute(w, nil)
|
||||
}
|
||||
Reference in New Issue
Block a user