Fix: load json syscards, replace char and user

This commit is contained in:
Grail Finder
2025-02-03 20:18:17 +03:00
parent eb53b13381
commit 6676b7d12b
4 changed files with 20 additions and 29 deletions

12
main.go
View File

@@ -1,6 +1,9 @@
package main
import (
"flag"
"fmt"
"net/http"
"unicode"
"github.com/rivo/tview"
@@ -24,6 +27,15 @@ func isASCII(s string) bool {
}
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
return
}
pages.AddPage("main", flex, true, true)
if err := app.SetRoot(pages,
true).EnableMouse(true).EnablePaste(true).Run(); err != nil {