feat(18): adding dynamic data
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user