Cleanup main (#470)

* main: clean up

* server: replace magical constants and use them for app name tracking
This commit is contained in:
Travis Reeder
2017-01-03 14:59:26 -08:00
committed by GitHub
parent e75e115180
commit 1c8d12b09e
18 changed files with 203 additions and 129 deletions

View File

@@ -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"
)
@@ -13,7 +14,7 @@ func (s *Server) handleAppDelete(c *gin.Context) {
ctx := c.MustGet("ctx").(context.Context)
log := common.Logger(ctx)
app := &models.App{Name: ctx.Value("appName").(string)}
app := &models.App{Name: c.MustGet(api.AppName).(string)}
routes, err := s.Datastore.GetRoutesByApp(ctx, app.Name, &models.RouteFilter{})
if err != nil {