Files
fn-serverless/api/server/apps_list.go
2017-07-19 13:44:26 -07:00

23 lines
417 B
Go

package server
import (
"net/http"
"github.com/gin-gonic/gin"
"gitlab-odx.oracle.com/odx/functions/api/models"
)
func (s *Server) handleAppList(c *gin.Context) {
ctx := c.Request.Context()
filter := &models.AppFilter{}
apps, err := s.Datastore.GetApps(ctx, filter)
if err != nil {
handleErrorResponse(c, err)
return
}
c.JSON(http.StatusOK, appsResponse{"Successfully listed applications", apps})
}