Skip to content

Commit

Permalink
remove url patcher
Browse files Browse the repository at this point in the history
  • Loading branch information
lmangani authored Apr 11, 2022
1 parent 9eb127b commit 2644505
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions fluxpipe-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ func exec(inputString string) (string, string) {

func main() {

url := flag.String("url", "", "ClickHouse MYSQL API URL")
port := flag.String("port", "8086", "API port")
stdin := flag.Bool("stdin", false, "STDIN mode")
cors := flag.Bool("cors", true, "API cors mode")
Expand All @@ -142,12 +141,6 @@ func main() {
fmt.Fprintln(os.Stderr, "reading standard input:", err)
}

if len(*url) > 1 {
orig := `"clickhouse"`
repl := fmt.Sprintf(`"mysql", dataSourceName: "%s"`, *url)
inputString = strings.ReplaceAll(inputString, orig, repl)
}

buf, _ := exec(inputString)
fmt.Println(strings.Replace(buf, "\r\n", "\n", -1))

Expand All @@ -166,7 +159,7 @@ func main() {
}

e.GET("/", func(c echo.Context) error {
return c.String(http.StatusOK, "F-L-U-X-P-I-P-E")
return c.String(http.StatusOK, "|> FluxPIPE")
})
e.GET("/ping", func(c echo.Context) error {
return c.String(204, "OK")
Expand All @@ -177,7 +170,7 @@ func main() {
e.POST("/api/v2/query", postQuery)
e.POST("/query", postQuery)

fmt.Println("|> FluxPIPE |>")
fmt.Println("|> FluxPIPE")
e.Logger.Fatal(e.Start(":"+*port))
}
}
Expand Down

0 comments on commit 2644505

Please sign in to comment.