diff options
| author | Christine Dodrill <me@christine.website> | 2016-12-14 09:30:48 -0800 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2016-12-14 09:30:48 -0800 |
| commit | b65845c8ac8d2a62f10bc5c577b1f70b4b4bfcf3 (patch) | |
| tree | eb0402a06f9f75e5c95a1fdffb82860490474e60 | |
| parent | cee6a8498ce3b7f872d961d754b7286de5d261ac (diff) | |
| download | xesite-b65845c8ac8d2a62f10bc5c577b1f70b4b4bfcf3.tar.xz xesite-b65845c8ac8d2a62f10bc5c577b1f70b4b4bfcf3.zip | |
backend: document datatypes
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | backend/christine.website/main.go | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..741b06f --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# My Site + +Version 2 + +This is intended as my portfolio site. This is a site made with [pux](https://github.com/alexmingoia/purescript-pux) +and [Go](https://golang.org). diff --git a/backend/christine.website/main.go b/backend/christine.website/main.go index 63045a8..83dc47a 100644 --- a/backend/christine.website/main.go +++ b/backend/christine.website/main.go @@ -15,6 +15,7 @@ import ( "github.com/gernest/front" ) +// Post is a single post summary for the menu. type Post struct { Title string `json:"title"` Link string `json:"link"` @@ -22,6 +23,7 @@ type Post struct { Date string `json:"date"` } +// Posts implements sort.Interface for a slice of Post objects. type Posts []*Post func (p Posts) Len() int { return len(p) } @@ -78,7 +80,7 @@ func init() { func main() { http.HandleFunc("/api/blog/posts", writeBlogPosts) - http.HandleFunc("/api/blog/post", func(w http.ResponseWriter, r *http.Request) { + http.HandleFunc("/api/blog/name", func(w http.ResponseWriter, r *http.Request) { q := r.URL.Query() name := q.Get("name") |
