From e284365cb05c330c9f675240e5a641f0bd3d1971 Mon Sep 17 00:00:00 2001 From: leeesoraaa Date: Sun, 28 Jul 2024 05:52:12 +0900 Subject: [PATCH] HelloWorld --- .../java/com/example/hello/HelloApplication.java | 14 +++++++++++++- src/main/resources/application.properties | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/example/hello/HelloApplication.java b/src/main/java/com/example/hello/HelloApplication.java index bad803a..0c6861e 100644 --- a/src/main/java/com/example/hello/HelloApplication.java +++ b/src/main/java/com/example/hello/HelloApplication.java @@ -2,13 +2,25 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +@RestController @SpringBootApplication public class HelloApplication { public static void main(String[] args) { - System.out.println("Hello World Test2"); SpringApplication.run(HelloApplication.class, args); } + @GetMapping(value = "/") + public String doGetHelloWorld() { + return "Hello World"; + } + + @GetMapping(value = "/korea") + public String doGetHelloKorea() { + return "Hello Korea"; + } + } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 2f4e9b4..f71eba1 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +1,4 @@ spring.application.name=hello + +server.port=8080 +application.name = hello \ No newline at end of file