Files
fn-serverless/api/server/apps_v1_get.go
Owen Cliffe b8b544ed25 HTTP Triggers hookup (#1086)
* Initial suypport for invoking tiggers

* dupe method

* tighten server constraints

* runner tests not working yet

* basic route tests passing

* post rebase fixes

* add hybrid support for trigger invoke and tests

* consoloidate all hybrid evil into one place

* cleanup and make triggers unique by source

* fix oops with Agent

* linting

* review fixes
2018-07-05 12:56:07 -05:00

24 lines
441 B
Go

package server
import (
"net/http"
"github.com/fnproject/fn/api"
"github.com/gin-gonic/gin"
)
// TODO: Deprecate with V1 API
func (s *Server) handleV1AppGetByIdOrName(c *gin.Context) {
ctx := c.Request.Context()
param := c.MustGet(api.AppID).(string)
app, err := s.datastore.GetAppByID(ctx, param)
if err != nil {
handleV1ErrorResponse(c, err)
return
}
c.JSON(http.StatusOK, appResponse{"Successfully loaded app", app})
}