Integrate mkube storageclass api with UI (#156)
This commit is contained in:
@@ -164,7 +164,7 @@ func FileServerMiddleware(next http.Handler) http.Handler {
|
||||
switch {
|
||||
case strings.HasPrefix(r.URL.Path, "/ws"):
|
||||
serveWS(w, r)
|
||||
case strings.HasPrefix(r.URL.Path, "/api/v1/tenants"):
|
||||
case strings.HasPrefix(r.URL.Path, "/api/v1/mkube"):
|
||||
client := &http.Client{}
|
||||
serverMkube(client, w, r)
|
||||
case strings.HasPrefix(r.URL.Path, "/api"):
|
||||
|
||||
@@ -30,6 +30,7 @@ import (
|
||||
// serverMkube handles calls for mkube
|
||||
func serverMkube(client *http.Client, w http.ResponseWriter, req *http.Request) {
|
||||
// destination of the request, the mkube server
|
||||
req.URL.Path = strings.Replace(req.URL.Path, "/mkube", "", 1)
|
||||
targetURL := fmt.Sprintf("%s%s", getM3Host(), req.URL.String())
|
||||
|
||||
// set the HTTP method, url, and m3Req body
|
||||
|
||||
Reference in New Issue
Block a user