add api host setting

This commit is contained in:
josc146
2023-05-24 22:03:30 +08:00
parent 03a494e1f1
commit f439b3d382
8 changed files with 25 additions and 10 deletions

View File

@@ -6,12 +6,12 @@ import (
"strconv"
)
func (a *App) StartServer(port int) (string, error) {
func (a *App) StartServer(port int, host string) (string, error) {
python, err := GetPython()
if err != nil {
return "", err
}
return Cmd(python, "./backend-python/main.py", strconv.Itoa(port))
return Cmd(python, "./backend-python/main.py", strconv.Itoa(port), host)
}
func (a *App) ConvertModel(modelPath string, strategy string, outPath string) (string, error) {