wings/api/handlers.go
Jakob Schrettenbrunner 059ea8a047 add all old routes and handlers
add html index page when not authenticated
fixed auth's handling of empty permissions
2017-08-02 22:02:34 +02:00

31 lines
547 B
Go

package api
import (
"net/http"
"github.com/Pterodactyl/wings/constants"
"github.com/gin-gonic/gin"
)
// handleGetIndex handles GET /
func handleGetIndex(c *gin.Context) {
auth, _ := c.Get(ContextVarAuth)
if auth := auth.(AuthorizationManager); auth.hasPermission("c:info") {
}
c.Header("Content-Type", "text/html")
c.String(http.StatusOK, constants.IndexPage)
}
// handlePutConfig handles PUT /config
func handlePutConfig(c *gin.Context) {
}
// handlePatchConfig handles PATCH /config
func handlePatchConfig(c *gin.Context) {
}