feat(18): adding dynamic data

This commit is contained in:
efim
2024-03-13 17:08:03 +00:00
parent 269cb2967c
commit e81a22dd10
2 changed files with 24 additions and 14 deletions

View File

@@ -4,13 +4,18 @@ import (
"fmt"
"net/http"
"sunshine.industries/temp-exercise/templates"
"github.com/a-h/templ"
"sunshine.industries/temp-exercise/templates"
)
func main() {
component := templates.IndexPage()
component := templates.IndexPage(templates.PageData{
Balance: 1021.12,
Expenses: []float32{37.45, 34.91, 37.36, 31.07, 7.39, 43.28, 25.48},
TotalThisMonth: 612.41,
PercentComparedToLastMonth: 3.1,
})
http.Handle("/", templ.Handler(component))
staticFs := http.FileServer(http.Dir("./static"))