21 lines
402 B
Go
21 lines
402 B
Go
package backend_golang
|
|
|
|
import (
|
|
"os/exec"
|
|
"path/filepath"
|
|
"strconv"
|
|
)
|
|
|
|
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
|
|
}
|
|
return string(out), nil
|
|
}
|