Skip to content

Commit

Permalink
fix cli commands that interact with the api
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinfuchs committed Feb 3, 2024
1 parent 20f9bfc commit 28e16c6
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 24 deletions.
52 changes: 52 additions & 0 deletions examples/automod/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions examples/automod/yarn.lock

This file was deleted.

3 changes: 1 addition & 2 deletions kite-docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions kite-service/cmd/config/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func loginCMD() *cli.Command {
&cli.StringFlag{
Name: "server",
Usage: "The Kite server to deploy to",
Value: "http://localhost:3000",
Value: "http://localhost:8080",
},
},
Action: func(c *cli.Context) error {
Expand All @@ -45,7 +45,7 @@ func loginCMD() *cli.Command {

func runLogin(serverURL *url.URL, cfg *config.GlobalConfig) error {
authStartURL := *serverURL
authStartURL.Path = path.Join(authStartURL.Path, "/api/v1/auth/cli/start")
authStartURL.Path = path.Join(authStartURL.Path, "/v1/auth/cli/start")
resp, err := http.Post(authStartURL.String(), "application/json", nil)
if err != nil {
return fmt.Errorf("Failed to start auth: %v", err)
Expand All @@ -68,7 +68,7 @@ func runLogin(serverURL *url.URL, cfg *config.GlobalConfig) error {
loginCode := loginResp.Data.Code

authRedirectURL := *serverURL
authRedirectURL.Path = path.Join(authRedirectURL.Path, "/api/v1/auth/cli/redirect")
authRedirectURL.Path = path.Join(authRedirectURL.Path, "/v1/auth/cli/redirect")
authRedirectURL.RawQuery = url.Values{
"code": {loginCode},
}.Encode()
Expand All @@ -77,7 +77,7 @@ func runLogin(serverURL *url.URL, cfg *config.GlobalConfig) error {
fmt.Println("\n\nWaiting for you to complete the login ...")

authCheckURL := *serverURL
authCheckURL.Path = path.Join(authCheckURL.Path, "/api/v1/auth/cli/check")
authCheckURL.Path = path.Join(authCheckURL.Path, "/v1/auth/cli/check")
authCheckURL.RawQuery = url.Values{
"code": {loginCode},
}.Encode()
Expand Down
4 changes: 2 additions & 2 deletions kite-service/cmd/plugin/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func deployCMD() *cli.Command {
&cli.StringFlag{
Name: "server",
Usage: "The Kite server to deploy to",
Value: "http://localhost:3000",
Value: "http://localhost:8080",
},
},
Action: func(c *cli.Context) error {
Expand Down Expand Up @@ -81,7 +81,7 @@ func runDeploy(
return fmt.Errorf("No session for server %s, login first!", serverURL.String())
}

serverURL.Path = path.Join(serverURL.Path, "api/v1/guilds", guildID, "deployments")
serverURL.Path = path.Join(serverURL.Path, "v1/guilds", guildID, "deployments")

wasmPath := filepath.Join(basePath, cfg.Module.Build.Out)
wasm, err := os.ReadFile(wasmPath)
Expand Down

0 comments on commit 28e16c6

Please sign in to comment.