mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-10-21 10:58:23 +00:00
make serving published repos in api mode configurable
This commit is contained in:
1 parent
f74217ed9c
commit
0fdba29d51
6 files changed
+21
-14
No files matched your search
+11
-10
@@ -51,18 +51,19 @@ func Router(c *ctx.AptlyContext) http.Handler {
|
||||
MetricsCollectorRegistrar.Register(router)
|
||||
}
|
||||
|
||||
router.GET("/repos/:storage/*pkgPath", func(c *gin.Context) {
|
||||
pkgpath := c.Param("pkgPath")
|
||||
if c.Config().ServeInAPIMode {
|
||||
router.GET("/repos/:storage/*pkgPath", func(c *gin.Context) {
|
||||
pkgpath := c.Param("pkgPath")
|
||||
|
||||
storage := c.Param("storage")
|
||||
if storage == "-" {
|
||||
storage = ""
|
||||
}
|
||||
storage := c.Param("storage")
|
||||
if storage == "-" {
|
||||
storage = ""
|
||||
}
|
||||
|
||||
publicPath := context.GetPublishedStorage("filesystem:" + storage).(aptly.FileSystemPublishedStorage).PublicPath()
|
||||
|
||||
c.FileFromFS(pkgpath, http.Dir(publicPath))
|
||||
})
|
||||
publicPath := context.GetPublishedStorage("filesystem:" + storage).(aptly.FileSystemPublishedStorage).PublicPath()
|
||||
c.FileFromFS(pkgpath, http.Dir(publicPath))
|
||||
})
|
||||
}
|
||||
|
||||
api := router.Group("/api")
|
||||
if context.Flags().Lookup("no-lock").Value.Get().(bool) {
|
||||
|
||||
Reference in new issue
Block a user