back to flask :-)

This commit is contained in:
Yax 2017-07-16 17:35:38 +02:00
parent 7cbcb0b5cb
commit 7deccf7425
10 changed files with 69 additions and 95 deletions

View file

@ -47,7 +47,7 @@ func commentsCount(w http.ResponseWriter, r *http.Request) {
}
// relay request to stacosys
//fmt.Println("QUERY: " + config.Stacosys + r.URL.String())
fmt.Println("QUERY: " + config.Stacosys + r.URL.String())
response, err := http.Get(config.Stacosys + r.URL.String())
if err != nil {
http.NotFound(w, r)
@ -80,6 +80,7 @@ func main() {
json.Unmarshal(file, &config)
fmt.Printf("config: %s\n", string(file))
http.HandleFunc("/comments/count/", commentsCount)
http.HandleFunc("/comments/count", commentsCount)
http.ListenAndServe(config.HostPort, nil)
}