minor changes of frontend main

This commit is contained in:
vinchent 2024-08-28 09:27:28 +02:00
parent 52a5fc0f3c
commit a0641d314c

View File

@ -12,15 +12,14 @@ func main() {
render(w, "test.page.gohtml")
})
fmt.Println("Starting front end service on port 80")
err := http.ListenAndServe(":80", nil)
fmt.Println("Starting front end service on port 4000")
err := http.ListenAndServe(":4000", nil)
if err != nil {
log.Panic(err)
}
}
func render(w http.ResponseWriter, t string) {
partials := []string{
"./cmd/web/templates/base.layout.gohtml",
"./cmd/web/templates/header.partial.gohtml",
@ -30,9 +29,7 @@ func render(w http.ResponseWriter, t string) {
var templateSlice []string
templateSlice = append(templateSlice, fmt.Sprintf("./cmd/web/templates/%s", t))
for _, x := range partials {
templateSlice = append(templateSlice, x)
}
templateSlice = append(templateSlice, partials...)
tmpl, err := template.ParseFiles(templateSlice...)
if err != nil {