app run skeleton
This commit is contained in:
15
api.go
15
api.go
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user