summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-02-06 16:57:37 +0300
committerGrail Finder <wohilas@gmail.com>2025-02-06 16:57:37 +0300
commit884004a855980444319769d9b10f9cf6e3ba33cd (patch)
tree3753697d0dd0e341595a1e15fb8aee9f1c06833b /main.go
parent6676b7d12b3bb381fdfacea816d50e9b86f9333d (diff)
Enha: server update
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 2 insertions, 5 deletions
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)