Files
fn-serverless/api/server/routes_get.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

25 lines
484 B
Go

package server
import (
"net/http"
"path"
"github.com/gin-gonic/gin"
"github.com/fnproject/fn/api"
)
func (s *Server) handleRouteGet(c *gin.Context) {
ctx := c.Request.Context()
appName := c.MustGet(api.AppName).(string)
routePath := path.Clean(c.MustGet(api.Path).(string))
route, err := s.Datastore.GetRoute(ctx, appName, routePath)
if err != nil {
handleErrorResponse(c, err)
return
}
c.JSON(http.StatusOK, routeResponse{"Successfully loaded route", route})
}