personal-website/iternal/controllers/IndexController.go
2025-01-28 18:43:37 +03:00

21 lines
461 B
Go

/*
Controller that only shows index template! Simple as it is!
*/
package controllers
import (
"context"
"net/http"
"github.com/dixxe/personal-website/web/templates"
)
// Controller that shows "/" root page.
func GetIndexHandler(w http.ResponseWriter, r *http.Request) {
// Templates are components and this is basic way to render them.
// I use this way across all code
component := templates.IndexPage()
component.Render(context.Background(), w)
}