You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to serve parts of html and build a page using goji?
For example if I wanted to serve the of results.html, write , and then in a for loop write contents of the body of that page, and then . Or will I have to use standard Golang features like:
func viewHandler(w http.ResponseWriter, r *http.Request) {
title := r.URL.Path[len("/view/"):]
p, _ := loadPage(title)
fmt.Fprintf(w, "<h1>%s</h1><div>%s</div>", p.Title, p.Body)
}
The text was updated successfully, but these errors were encountered:
Is it possible to serve parts of html and build a page using goji?
For example if I wanted to serve the of results.html, write , and then in a for loop write contents of the body of that page, and then . Or will I have to use standard Golang features like:
The text was updated successfully, but these errors were encountered: