root page, new layout

This commit is contained in:
2025-12-13 21:02:22 +01:00
parent 0a92fd678f
commit ca65b24899
6 changed files with 140 additions and 3 deletions
+27
View File
@@ -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)
}