Files
teletypegames/http/controller.root.go
T
2025-12-13 21:02:22 +01:00

28 lines
561 B
Go

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)
}