|
1 | 1 | package main |
2 | 2 |
|
3 | 3 | import ( |
4 | | - "encoding/json" |
5 | 4 | "fmt" |
6 | 5 | "github.com/softwareplace/wireguard-api/cmd/stream/parse" |
7 | 6 | "github.com/softwareplace/wireguard-api/cmd/stream/spec" |
@@ -34,25 +33,25 @@ func main() { |
34 | 33 | os.Exit(1) |
35 | 34 | } |
36 | 35 |
|
37 | | - // Convert dump to JSON and print it |
38 | | - jsonDump, err := json.MarshalIndent(dump, "", " ") |
39 | | - if err != nil { |
40 | | - log.Fatalf("Error converting dump to JSON: %v", err) |
41 | | - } |
42 | | - |
43 | | - // Copy JSON dump to clipboard |
44 | | - if err := exec.Command("bash", "-c", fmt.Sprintf("echo '%s' | xclip -selection clipboard", string(jsonDump))).Run(); err != nil { |
45 | | - log.Fatalf("Failed to copy JSON dump to clipboard: %v", err) |
46 | | - } |
47 | | - |
48 | | - fmt.Println("Dump as JSON:") |
49 | | - fmt.Println(string(jsonDump)) |
| 36 | + //// Convert dump to JSON and print it |
| 37 | + //jsonDump, err := json.MarshalIndent(dump, "", " ") |
| 38 | + //if err != nil { |
| 39 | + // log.Fatalf("Error converting dump to JSON: %v", err) |
| 40 | + //} |
| 41 | + // |
| 42 | + //// Copy JSON dump to clipboard |
| 43 | + //if err := exec.Command("bash", "-c", fmt.Sprintf("echo '%s' | xclip -selection clipboard", string(jsonDump))).Run(); err != nil { |
| 44 | + // log.Fatalf("Failed to copy JSON dump to clipboard: %v", err) |
| 45 | + //} |
| 46 | + // |
| 47 | + //fmt.Println("Dump as JSON:") |
| 48 | + //fmt.Println(string(jsonDump)) |
50 | 49 |
|
51 | 50 | api := http_api.NewApi(types.Nil{}) |
52 | 51 | config := http_api.Config(streamEnv.Server). |
53 | 52 | WithPath("peers/stream"). |
54 | 53 | WithHeader("Authorization", streamEnv.Authorization). |
55 | | - WithHeader(request.XApiKey, streamEnv.Authorization). |
| 54 | + WithHeader(request.XApiKey, streamEnv.ApiKey). |
56 | 55 | WithBody(dump). |
57 | 56 | WithExpectedStatusCode(http.StatusCreated) |
58 | 57 |
|
|
0 commit comments