package it.enea.cruise.controller;

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

import java.time.LocalDateTime;
import java.util.Map;

@RestController
@RequestMapping("/")
public class HomeController {
    @Value("${spring.profiles.active}")
    private String profile;

    @GetMapping("")
    public Map<String, String> index() {
        return Map.of(
                "status", "Running",
                "timestamp", LocalDateTime.now().toString(),
                "env", profile
        );
    }
}
