Files
fn-serverless/api/server/apps_list.go
2017-04-19 09:49:12 -06:00

24 lines
436 B
Go

package server
import (
"context"
"net/http"
"github.com/gin-gonic/gin"
"github.com/kumokit/functions/api/models"
)
func (s *Server) handleAppList(c *gin.Context) {
ctx := c.MustGet("ctx").(context.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})
}