소스 검색

join via api - netmaker changes

Signed-off-by: Matthew R. Kasun <[email protected]>
Matthew R. Kasun 3 년 전
부모
커밋
8a75ef5931
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      controllers/node.go
  2. 1 1
      netclient/functions/join.go

+ 1 - 1
controllers/node.go

@@ -31,7 +31,7 @@ func nodeHandlers(r *mux.Router) {
 	r.HandleFunc("/api/nodes/{network}/{nodeid}/createingress", securityCheck(false, http.HandlerFunc(createIngressGateway))).Methods("POST")
 	r.HandleFunc("/api/nodes/{network}/{nodeid}/deleteingress", securityCheck(false, http.HandlerFunc(deleteIngressGateway))).Methods("DELETE")
 	r.HandleFunc("/api/nodes/{network}/{nodeid}/approve", authorize(true, "user", http.HandlerFunc(uncordonNode))).Methods("POST")
-	r.HandleFunc("/api/nodes/{network}", createNode).Methods("POST")
+	r.HandleFunc("/api/nodes/join", createNode).Methods("POST")
 	r.HandleFunc("/api/nodes/adm/{network}/lastmodified", authorize(true, "network", http.HandlerFunc(getLastModified))).Methods("GET")
 	r.HandleFunc("/api/nodes/adm/{network}/authenticate", authenticate).Methods("POST")
 }

+ 1 - 1
netclient/functions/join.go

@@ -108,7 +108,7 @@ func JoinNetwork(cfg *config.ClientConfig, privateKey string) error {
 	}
 
 	log.Println("calling api")
-	response, err := join(request, cfg.Server.API, cfg.Node.AccessKey)
+	response, err := join(request, cfg.Server.API+"/api/nodes/join", cfg.Node.AccessKey)
 	if err != nil {
 		return fmt.Errorf("error joining network %w", err)
 	}