app run skeleton

This commit is contained in:
shoopea
2025-10-19 13:33:22 +02:00
parent 2aca8b1ceb
commit 6ae863b60c
3 changed files with 31 additions and 8 deletions

15
api.go
View File

@@ -14,10 +14,17 @@ func ApiRun(c *gin.Context) {
}
func ApiRunApp(c *gin.Context) {
if _, ok := cfg.apps[c.Param("app")]; ok {
c.JSON(http.StatusOK, gin.H{
"message": "done",
})
if app, ok := cfg.apps[c.Param("app")]; ok {
if err := app.RunFull(); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{
"message": "error",
"error": err,
})
} else {
c.JSON(http.StatusOK, gin.H{
"message": "done",
})
}
}
c.JSON(http.StatusInternalServerError, gin.H{
"message": "error",