Browse Source

Updated with meshclient

cameronts 2 years ago
parent
commit
edd35f4359
2 changed files with 18 additions and 2 deletions
  1. 10 1
      controllers/files.go
  2. 8 1
      swagger.yaml

+ 10 - 1
controllers/files.go

@@ -1,10 +1,19 @@
 package controller
 package controller
 
 
 import (
 import (
-	"github.com/gorilla/mux"
 	"net/http"
 	"net/http"
+
+	"github.com/gorilla/mux"
 )
 )
 
 
 func fileHandlers(r *mux.Router) {
 func fileHandlers(r *mux.Router) {
+	// swagger:route GET /meshclient/files/{filename} meshclient fileServer
+	//
+	// Retrieve a file from the file server
+	//
+	//		Schemes: https
+	//
+	// 		Security:
+	//   		oauth
 	r.PathPrefix("/meshclient/files").Handler(http.StripPrefix("/meshclient/files", http.FileServer(http.Dir("./meshclient/files"))))
 	r.PathPrefix("/meshclient/files").Handler(http.StripPrefix("/meshclient/files", http.FileServer(http.Dir("./meshclient/files"))))
 }
 }

+ 8 - 1
swagger.yaml

@@ -1,7 +1,6 @@
 basePath: /
 basePath: /
 consumes:
 consumes:
     - application/json
     - application/json
-host: netmaker.io
 info:
 info:
     description: |-
     description: |-
         API Usage
         API Usage
@@ -455,6 +454,14 @@ paths:
                 - https
                 - https
             tags:
             tags:
                 - nodes
                 - nodes
+    /meshclient/files/{filename}:
+        get:
+            description: Retrieve a file from the file server
+            operationId: fileServer
+            schemes:
+                - https
+            tags:
+                - meshclient
 produces:
 produces:
     - application/json
     - application/json
 schemes:
 schemes: