mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
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
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"path"
|
||||
|
||||
"github.com/fnproject/fn/api"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"path"
|
||||
)
|
||||
|
||||
func routeGet(s *Server, appID string, c *gin.Context) {
|
||||
func (s *Server) handleRouteGetAPI(c *gin.Context) {
|
||||
ctx := c.Request.Context()
|
||||
|
||||
routePath := path.Clean("/" + c.MustGet(api.Path).(string))
|
||||
route, err := s.datastore.GetRoute(ctx, appID, routePath)
|
||||
route, err := s.datastore.GetRoute(ctx, c.MustGet(api.AppID).(string), routePath)
|
||||
if err != nil {
|
||||
handleV1ErrorResponse(c, err)
|
||||
return
|
||||
@@ -20,11 +19,3 @@ func routeGet(s *Server, appID string, c *gin.Context) {
|
||||
|
||||
c.JSON(http.StatusOK, routeResponse{"Successfully loaded route", route})
|
||||
}
|
||||
|
||||
func (s *Server) handleRouteGetAPI(c *gin.Context) {
|
||||
routeGet(s, c.MustGet(api.AppID).(string), c)
|
||||
}
|
||||
|
||||
func (s *Server) handleRouteGetRunner(c *gin.Context) {
|
||||
routeGet(s, c.MustGet(api.AppID).(string), c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user