Merge pull request #6 from modelcontextprotocol/sridharavinash/seed
Add count to server response and fix Makefile paths
This commit is contained in:
commit
4c401c0b25
2 changed files with 5 additions and 2 deletions
4
Makefile
4
Makefile
|
|
@ -40,12 +40,12 @@ test:
|
||||||
# Run the application
|
# Run the application
|
||||||
run:
|
run:
|
||||||
@echo "Running $(BINARY_NAME)..."
|
@echo "Running $(BINARY_NAME)..."
|
||||||
@$(GO) run $(MAIN_PATH)
|
@$(GO) run $(MAIN_PACKAGE)/main.go $(MAIN_PACKAGE)/version.go
|
||||||
|
|
||||||
# Run the application with test environment (using fake service)
|
# Run the application with test environment (using fake service)
|
||||||
run-test:
|
run-test:
|
||||||
@echo "Running $(BINARY_NAME) with test environment..."
|
@echo "Running $(BINARY_NAME) with test environment..."
|
||||||
@APP_ENV=test $(GO) run $(MAIN_PATH)
|
@APP_ENV=test $(GO) run $(MAIN_PACKAGE)/main.go $(MAIN_PACKAGE)/version.go
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
deps:
|
deps:
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ type PaginatedResponse struct {
|
||||||
// Metadata contains pagination metadata
|
// Metadata contains pagination metadata
|
||||||
type Metadata struct {
|
type Metadata struct {
|
||||||
NextCursor string `json:"next_cursor,omitempty"`
|
NextCursor string `json:"next_cursor,omitempty"`
|
||||||
|
Count int `json:"count,omitempty"`
|
||||||
|
Total int `json:"total,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServersHandler returns a handler for listing registry items
|
// ServersHandler returns a handler for listing registry items
|
||||||
|
|
@ -82,6 +84,7 @@ func ServersHandler(registry service.RegistryService) http.HandlerFunc {
|
||||||
if nextCursor != "" {
|
if nextCursor != "" {
|
||||||
response.Metadata = Metadata{
|
response.Metadata = Metadata{
|
||||||
NextCursor: nextCursor,
|
NextCursor: nextCursor,
|
||||||
|
Count: len(registries),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue