package cloud.nstart.terravault.ordinis.app.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class HealthController {

  @Value("${spring.application.name:ordinis-app}")
  private String appName;

  @Value("${ENVIRONMENT:dev}")
  private String environment;

  @GetMapping("/")
  public Map<String, String> root() {
    return Map.of(
      "service", appName,
      "environment", environment,
      "status", "ok"
    );
  }
}
