Home > AI > Backend > SpringBoot >

Environment

DemoApplication.java

RestController
@SpringBootApplication
public class DemoApplication {
    @Autowired
    private Environment env;

    public static void main(String[] args) throws IOException {
        SpringApplication.run(DemoApplication.class, args);
    }

    @GetMapping("/hello")
    public String getEnv() {
        System.out.println("shark-hello");

        return env.toString();
    }
}

Leave a Reply