This commit is contained in:
Pedro Nasser
2016-08-01 19:23:31 -03:00
parent f9f1ffaac5
commit dfc4be9861
25 changed files with 137 additions and 160 deletions

View File

@@ -0,0 +1,25 @@
package server
import (
"net/http"
"github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
)
func handleRouteDelete(c *gin.Context) {
log := c.MustGet("log").(logrus.FieldLogger)
appName := c.Param("app")
routeName := c.Param("route")
err := Api.Datastore.RemoveRoute(appName, routeName)
if err != nil {
log.WithError(err).Debug(models.ErrRoutesRemoving)
c.JSON(http.StatusInternalServerError, simpleError(models.ErrRoutesRemoving))
return
}
c.JSON(http.StatusOK, nil)
}