diff --git a/src/main/java/haveno/price/ApiController.java b/src/main/java/haveno/price/ApiController.java new file mode 100644 index 0000000..cb42d9d --- /dev/null +++ b/src/main/java/haveno/price/ApiController.java @@ -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 getVersion() { + Map response = new HashMap<>(); + response.put("version", env.getProperty("haveno.price-node.api.version", "")); + return response; + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 67421c6..a3ebfac 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -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=