Skip to content

justwatchcom/go-seo4ajax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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))
    }
})