Files
fn-serverless/api/server/apps_list.go
Travis Reeder 48e3781d5e Rename to GitHub (#3)
* circle

* Rename to github and fn->cli

*  Rename to github and fn->cli
2017-07-26 10:50:19 -07:00

23 lines
405 B
Go

package server
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/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})
}