Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 528 Bytes

README.md

File metadata and controls

17 lines (15 loc) · 528 Bytes

go-seo4ajax

Golang connector for Seo4Ajax GoDoc.

Code and tests is highly adapted from connect middleware.

http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
    if seo4ajax.IsPrerender(r) {
        err := seo4ajax.GetPrerenderedPage(w, r)
        if err != nil {
            log.Print(err.Error())
        }
    } else {
        fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
    }
})