Files
fn-serverless/api/server/call_get.go
Travis Reeder fdb4188146 Adds before/after app get/list. And some bug fixes/cleanup. (#610)
* Adds before/after app get/list. And some bug fixes/cleanup.

* Fix test
2017-12-21 09:32:03 -08:00

23 lines
448 B
Go

package server
import (
"net/http"
"github.com/fnproject/fn/api"
"github.com/gin-gonic/gin"
)
func (s *Server) handleCallGet(c *gin.Context) {
ctx := c.Request.Context()
appName := c.MustGet(api.AppName).(string)
callID := c.Param(api.Call)
callObj, err := s.Datastore().GetCall(ctx, appName, callID)
if err != nil {
handleErrorResponse(c, err)
return
}
c.JSON(http.StatusOK, callResponse{"Successfully loaded call", callObj})
}