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:
@@ -5,6 +5,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/iron-io/functions/api"
|
||||
"github.com/iron-io/functions/api/models"
|
||||
"github.com/iron-io/runner/common"
|
||||
)
|
||||
@@ -21,7 +22,7 @@ func (s *Server) handleRouteList(c *gin.Context) {
|
||||
|
||||
var routes []*models.Route
|
||||
var err error
|
||||
if appName, ok := ctx.Value("appName").(string); ok && appName != "" {
|
||||
if appName, ok := c.MustGet(api.AppName).(string); ok && appName != "" {
|
||||
routes, err = s.Datastore.GetRoutesByApp(ctx, appName, filter)
|
||||
} else {
|
||||
routes, err = s.Datastore.GetRoutes(ctx, filter)
|
||||
|
||||
Reference in New Issue
Block a user