Skip to content

Commit

Permalink
fix: POST inspect path
Browse files Browse the repository at this point in the history
  • Loading branch information
gligneul committed Dec 26, 2023
1 parent a286dc2 commit bab2a04
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Like the Rollups Node, you may send inspect requests with GET or POST methods.
For instance, the command below sends an inspect input with payload `hi` to NoNodo.

```
curl -X POST -d "hi" http://127.0.0.1:8080/inspect/
curl -X POST -d "hi" http://127.0.0.1:8080/inspect
```

## Compatibility
Expand Down
4 changes: 2 additions & 2 deletions api/inspect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ info:
API that allows the DApp frontend to make inspect-state requests to the DApp backend.
paths:
/{payload}:
inspect/{payload}:
get:
operationId: inspect
summary: Inspect DApp state via GET
Expand Down Expand Up @@ -51,7 +51,7 @@ paths:
schema:
$ref: "#/components/schemas/Error"

/:
inspect:
post:
operationId: inspect_post
summary: Inspect DApp state via POST
Expand Down
12 changes: 6 additions & 6 deletions internal/inspect/generated.go

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

2 changes: 1 addition & 1 deletion internal/inspect/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const InspectPollInterval = time.Millisecond * 100
// Register the rollup API to echo
func Register(e *echo.Echo, model *model.NonodoModel) {
inspectAPI := &inspectAPI{model}
RegisterHandlersWithBaseURL(e, inspectAPI, "inspect")
RegisterHandlers(e, inspectAPI)
}

// Shared struct for request handlers.
Expand Down
2 changes: 1 addition & 1 deletion internal/nonodo/nonodo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (s *NonodoSuite) SetupTest(opts NonodoOpts) {
graphqlEndpoint := fmt.Sprintf("http://%v:%v/graphql", opts.HttpAddress, opts.HttpPort)
s.graphqlClient = graphql.NewClient(graphqlEndpoint, nil)

inspectEndpoint := fmt.Sprintf("http://%v:%v/inspect", opts.HttpAddress, opts.HttpPort)
inspectEndpoint := fmt.Sprintf("http://%v:%v/", opts.HttpAddress, opts.HttpPort)
s.inspectClient, err = inspect.NewClientWithResponses(inspectEndpoint)
s.Nil(err)
}
Expand Down

0 comments on commit bab2a04

Please sign in to comment.