mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
20 lines
345 B
Go
20 lines
345 B
Go
package router
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/Sirupsen/logrus"
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/iron-io/functions/api/runner"
|
|
)
|
|
|
|
func handleRunner(c *gin.Context) {
|
|
log := c.MustGet("log").(logrus.FieldLogger)
|
|
|
|
err := runner.Run(c)
|
|
if err != nil {
|
|
log.Debug(err)
|
|
c.JSON(http.StatusInternalServerError, simpleError(err))
|
|
}
|
|
}
|