photoprism/internal/api/config.go
Michael Mayer 9a5d4fa719 Backend: Indexing improvements #154
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-05-29 18:04:30 +02:00

20 lines
411 B
Go

package api
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/photoprism/photoprism/internal/config"
)
// GET /api/v1/config
func GetConfig(router *gin.RouterGroup, conf *config.Config) {
router.GET("/config", func(c *gin.Context) {
if Unauthorized(c, conf) {
c.AbortWithStatusJSON(http.StatusUnauthorized, ErrUnauthorized)
return
}
c.JSON(http.StatusOK, conf.ClientConfig())
})
}