socialnetworknews-api

git clone git://archive.git.mtrnord.blog/SocialNetworkNews/socialnetworknews-api.git
Log | Files | Refs | LICENSE

commit dc5d1b2789e530cea353f7f305428063173c70ff
parent 66567411879cb5e5bc98180fc1249843bba6267e
Author: MTRNord <mtrnord1@gmail.com>
Date:   Sun, 18 Feb 2018 21:53:46 +0100

Allow POST on /papers

Diffstat:
Mapi/webserver.go | 5+++--
Mmain.go | 2+-
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/api/webserver.go b/api/webserver.go @@ -20,8 +20,9 @@ import ( func Yesterday(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) - uuid := vars["uuid"] - fmt.Println("UUID: ", uuid) + //TODO Use Database or File Structure (probably File Structure) + uuidVar := vars["uuid"] + fmt.Println("UUID: ", uuidVar) tweets, err := getTweets() if err != nil { diff --git a/main.go b/main.go @@ -22,7 +22,7 @@ func main() { fmt.Println("Logged in!") r := mux.NewRouter() - r.HandleFunc("/papers", web_api.Papers).Methods("GET") + r.HandleFunc("/papers", web_api.Papers).Methods("GET").Methods("POST") p := r.PathPrefix("/paper/{uuid}").Subrouter() p.HandleFunc("/yesterday", web_api.Yesterday).Methods("GET")