Notice
Recent Posts
Recent Comments
«   2025/01   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

충분히 쌓여가는

기본 실행(IntelliJ 실행) 본문

Spring/연습

기본 실행(IntelliJ 실행)

빌드이너프 2023. 9. 30. 12:01

@RestController

@GetMapping

hello() 클래스 추가

package com.buildenough.ch1;

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 Ch1Application {

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

    @GetMapping("/")
    public String hello() {
       return "Hello, Spring Boot";
    }
}

 

서버 실행 후

브라우저에 localhost:8080 요청