Skip to content

Commit

Permalink
Merge pull request #10 from datasage-io/AK-8428
Browse files Browse the repository at this point in the history
changed local to global
  • Loading branch information
ArulJeyananth authored Jul 14, 2022
2 parents a8471af + e647b25 commit b1123ff
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/integrations/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,19 @@ func loghandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "err : %v", err)
}
w.Header().Set("Content-Type", "application/json")
config, err := ReadLogConfig("src/conf/datasage.yaml")
if err != nil {
fmt.Fprintf(w, `{status: "not ok", "error": %v}`, err)
return
}
fmt.Fprintf(w, `{status : "ok"}`)
go func(http.ResponseWriter) {
config.StreamLogToAll(string(body))
if err != nil {
fmt.Fprintf(w, `{status: "not ok", "error": %v}`, err)
return
}
fmt.Fprintf(w, `{status : "ok"}`)
}(w)

}

var config, _ = ReadLogConfig("src/conf/datasage.yaml")

func RunServer() {

http.HandleFunc("/log", loghandler)
Expand Down

0 comments on commit b1123ff

Please sign in to comment.