mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Cleanup main (#470)
* main: clean up * server: replace magical constants and use them for app name tracking
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"path"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/iron-io/functions/api"
|
||||
"github.com/iron-io/functions/api/models"
|
||||
"github.com/iron-io/runner/common"
|
||||
)
|
||||
@@ -14,8 +15,8 @@ func (s *Server) handleRouteGet(c *gin.Context) {
|
||||
ctx := c.MustGet("ctx").(context.Context)
|
||||
log := common.Logger(ctx)
|
||||
|
||||
appName := ctx.Value("appName").(string)
|
||||
routePath := path.Clean(ctx.Value("routePath").(string))
|
||||
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 && err != models.ErrRoutesNotFound {
|
||||
|
||||
Reference in New Issue
Block a user