Skip to content

Commit

Permalink
s3 api: get publish root list
Browse files Browse the repository at this point in the history
  • Loading branch information
neolynx committed Apr 3, 2024
1 parent a0af6a2 commit b5b0a52
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ func Router(c *ctx.AptlyContext) http.Handler {
api.POST("/gpg/key", apiGPGAddKey)
}

{
api.GET("/s3", apiS3List)
}

{
api.GET("/files", apiFilesListDirs)
api.POST("/files/:dir", apiFilesUpload)
Expand Down
14 changes: 14 additions & 0 deletions api/s3.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package api

import (
"github.com/gin-gonic/gin"
)

// GET /api/s3
func apiS3List(c *gin.Context) {
keys := []string{}
for k := range context.Config().S3PublishRoots {
keys = append(keys, k)
}
c.JSON(200, keys)
}

0 comments on commit b5b0a52

Please sign in to comment.