mirror of
https://gitlab.com/nullmax17/personal-website.git
synced 2025-03-15 05:31:11 +03:00
21 lines
461 B
Go
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)
|
||
|
}
|