mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
22 lines
409 B
Go
22 lines
409 B
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"gitlab-odx.oracle.com/odx/functions/api"
|
|
)
|
|
|
|
func (s *Server) handleAppGet(c *gin.Context) {
|
|
ctx := c.Request.Context()
|
|
|
|
appName := c.MustGet(api.AppName).(string)
|
|
app, err := s.Datastore.GetApp(ctx, appName)
|
|
if err != nil {
|
|
handleErrorResponse(c, err)
|
|
return
|
|
}
|
|
|
|
c.JSON(http.StatusOK, appResponse{"Successfully loaded app", app})
|
|
}
|