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 2490799
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
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;
}
}
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
haveno.price-node.api.version=1.0.0
server.port=8078
spring.jackson.serialization.indent_output=true

# To enable another fee estimation endpoint, simply uncomment one of the following lines
# and set it to hostname exposing the fee estimation API
#haveno.price.mining.providers.mempoolHostname.5=someHostOrIP
# haveno.price.mining.providers.mempoolHostname.5=someHostOrIP
haveno.price.fiatcurrency.excluded=LBP
haveno.price.fiatcurrency.excludedByProvider=HUOBI:BRL,KRAKEN:AED
haveno.price.cryptocurrency.excluded=
Expand Down

0 comments on commit 2490799

Please sign in to comment.