Skip to content

Commit

Permalink
Add API version to api/version end-point
Browse files Browse the repository at this point in the history
  • Loading branch information
napoly committed Jan 27, 2024
1 parent 88aa16f commit 2bed5f9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.PAT_TOKEN }}

- name: Set up JDK 11
uses: actions/setup-java@v3
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/haveno/price/ApiController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package haveno.price;

import java.util.HashMap;
import java.util.Map;

import lombok.RequiredArgsConstructor;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class ApiController {

private final Environment env;

@GetMapping("/api/version")
public Map<String, String> getVersion() {
Map<String, String> response = new HashMap<>();
response.put("version", env.getProperty("haveno.price-node.api.version", ""));
return response;
}
}
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
haveno.price-node.api.version=1.0.0
server.port=8078
spring.jackson.serialization.indent_output=true

Expand Down

0 comments on commit 2bed5f9

Please sign in to comment.