minor changes of frontend main
This commit is contained in:
parent
52a5fc0f3c
commit
a0641d314c
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user