mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
feat(control): open app in browser on startup
This commit is contained in:
+9
-4
@@ -4,6 +4,7 @@ import (
|
|||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
"plg-mudics/control/frontend"
|
"plg-mudics/control/frontend"
|
||||||
|
"plg-mudics/shared"
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/labstack/echo/v4/middleware"
|
"github.com/labstack/echo/v4/middleware"
|
||||||
@@ -24,8 +25,12 @@ func main() {
|
|||||||
return ctx.String(http.StatusOK, "pong")
|
return ctx.String(http.StatusOK, "pong")
|
||||||
})
|
})
|
||||||
|
|
||||||
err := e.Start(":1323")
|
go func() {
|
||||||
if err != nil {
|
err := e.Start(":1323")
|
||||||
slog.Error("Failed to start Echo Webserver", "error", err)
|
if err != nil {
|
||||||
}
|
slog.Error("Failed to start Echo Webserver", "error", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
shared.OpenBrowserWindow("http://localhost:1323", false, false)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user