From 5d507d2810430779f94a8e6d31fc48f37fc9ff44 Mon Sep 17 00:00:00 2001 From: Denis Zheleztsov Date: Thu, 25 Mar 2021 18:25:40 +0300 Subject: [PATCH] [Static]: move to root --- node/api.go | 11 +++++------ node/elastic.go | 6 +----- templates/post.html | 6 ++++++ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/node/api.go b/node/api.go index 3af2103..5821929 100644 --- a/node/api.go +++ b/node/api.go @@ -5,7 +5,6 @@ import ( "io/ioutil" "net/http" "strings" - "time" "github.com/gorilla/mux" log "github.com/sirupsen/logrus" @@ -232,15 +231,15 @@ func Serve(listen string, es ESConf) { // Simple and clean SSR UI ssr := newSSR("./templates", es) - r.HandleFunc("/ssr", ssr.ssrRootHandler) + r.HandleFunc("/", ssr.ssrRootHandler) http.Handle("/", r) srv := http.Server{ - Handler: r, - Addr: listen, - WriteTimeout: 15 * time.Second, - ReadTimeout: 15 * time.Second, + Handler: r, + Addr: listen, + // WriteTimeout: 15 * time.Second, + // ReadTimeout: 15 * time.Second, } log.Print("Listening IDEC API on ", listen) diff --git a/node/elastic.go b/node/elastic.go index ed253eb..15aca14 100644 --- a/node/elastic.go +++ b/node/elastic.go @@ -111,12 +111,8 @@ func (es ESConf) GetEchoMessageHashes(echo string) []string { log.Error(err.Error()) return hashes } - defer resp.Body.Close() - content, _ := ioutil.ReadAll(resp.Body) - log.Info(string(content)) - var esr ESSearchResp err = json.NewDecoder(resp.Body).Decode(&esr) if err != nil { @@ -253,7 +249,7 @@ func (es ESConf) GetUEchoMessageHashes(echoes string) []string { o, err := strconv.Atoi(oflim[0]) l, err := strconv.Atoi(oflim[1]) if err != nil { - log.Print(err) + log.Error(err) } else { offset = o limit = l diff --git a/templates/post.html b/templates/post.html index f5a05a6..0cad48d 100644 --- a/templates/post.html +++ b/templates/post.html @@ -1,4 +1,10 @@ {{ define "post" }} +