preliminary usable features

This commit is contained in:
josc146
2023-05-17 11:39:00 +08:00
parent 53502a8c3d
commit c947052574
21 changed files with 1187 additions and 1080 deletions

View File

@@ -2,10 +2,16 @@ package backend_golang
import (
"os/exec"
"path/filepath"
"strconv"
)
func (a *App) StartServer(strategy string, modelPath string) (string, error) {
cmd := exec.Command("cmd-helper", "python", "./backend-python/main.py", strategy, modelPath)
func (a *App) StartServer(port int) (string, error) {
cmdHelper, err := filepath.Abs("./cmd-helper")
if err != nil {
return "", err
}
cmd := exec.Command(cmdHelper, "python", "./backend-python/main.py", strconv.Itoa(port))
out, err := cmd.CombinedOutput()
if err != nil {
return "", err