From 884004a855980444319769d9b10f9cf6e3ba33cd Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Thu, 6 Feb 2025 16:57:37 +0300 Subject: Enha: server update --- main.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 7766a60..a95db19 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,6 @@ package main import ( "flag" "fmt" - "net/http" "unicode" "github.com/rivo/tview" @@ -30,10 +29,8 @@ func main() { apiPort := flag.Int("port", 0, "port to host api") flag.Parse() if apiPort != nil && *apiPort > 3000 { - // start api server - http.HandleFunc("POST /completion", completion) - http.ListenAndServe(fmt.Sprintf(":%d", *apiPort), nil) - // no tui + srv := Server{} + srv.ListenToRequests(fmt.Sprintf("%d", *apiPort)) return } pages.AddPage("main", flex, true, true) -- cgit v1.2.3