Skip to content

Commit

Permalink
feat: Add API server capability to serve UI extensions from shared dir (
Browse files Browse the repository at this point in the history
argoproj#6766)

Signed-off-by: Remington Breeze <[email protected]>
  • Loading branch information
rbreeze authored Jul 20, 2021
1 parent 9c690a1 commit d7a8a87
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,13 @@ func (a *ArgoCDServer) newHTTPServer(ctx context.Context, port int, grpcWebHandl
// Serve cli binaries directly from API server
registerDownloadHandlers(mux, "/download")

// Serve extensions
var extensionsApiPath = "/extensions/"
var extensionsSharedPath = "/tmp/extensions/"

extHandler := http.StripPrefix(extensionsApiPath, http.FileServer(http.Dir(extensionsSharedPath)))
mux.HandleFunc(extensionsApiPath, extHandler.ServeHTTP)

// Serve UI static assets
if a.StaticAssetsDir != "" {
var assetsHandler http.Handler = http.HandlerFunc(a.newStaticAssetsHandler(a.StaticAssetsDir, a.BaseHRef))
Expand Down

0 comments on commit d7a8a87

Please sign in to comment.