https://github.com/justwatchcom/go-seo4ajax
Golang connector for Seo4Ajax http://godoc.org/github.com/justwatchcom/go-seo4ajax
https://github.com/justwatchcom/go-seo4ajax
Last synced: 5 months ago
JSON representation
Golang connector for Seo4Ajax http://godoc.org/github.com/justwatchcom/go-seo4ajax
- Host: GitHub
- URL: https://github.com/justwatchcom/go-seo4ajax
- Owner: justwatchcom
- License: mit
- Created: 2015-08-14T08:32:27.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-12-09T15:56:17.000Z (over 6 years ago)
- Last Synced: 2025-09-29T06:39:34.223Z (9 months ago)
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 9
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-seo4ajax
Golang connector for Seo4Ajax [GoDoc](http://godoc.org/github.com/justwatchcom/go-seo4ajax).
Code and tests is highly adapted from [connect middleware](https://www.npmjs.com/package/connect-s4a).
```
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))
}
})
```