개발

[Spring Boot][IntelliJ] Welcome Page(시작페이지) 만들기

타밍 2023. 6. 27. 16:27

웹으로 접속하면 처음나오는 페이지를 Welcome Page라고 한다.

구글 google.com 으로 접속 했을 때 처음 나오는 아래의 페이지도 Welcome Page라고 할 수 있다.

 

스프링 부트는 Welcome Page에 대한 설명을 공식 문서에 기재 해 두었다.

 

Spring 공식 문서 ▼

https://docs.spring.io/spring-boot/docs/2.7.8/reference/html/web.html#web.servlet.spring-mvc.welcome-page

 

Web

Graceful shutdown is supported with all four embedded web servers (Jetty, Reactor Netty, Tomcat, and Undertow) and with both reactive and servlet-based web applications. It occurs as part of closing the application context and is performed in the earliest

docs.spring.io

 

스프링 부트는 가장 먼저 구성된 static 콘텐츠 위치에서 index.html 파일을 찾으며
···
발견되면 자동으로 어프리케이션의 Welcome Page(시작 페이지) 로 사용된다.

 

위에서 말하는 static은 프로젝트의 main/resources/static 파일 경로를 뜻한다.

main/resource/static

 

즉, static/index.html 이 해당 프로젝트의 시작 페이지가 된다는 뜻이다.

애플리케이션의 시작점을 구성하고 싶을 때는 static/index.html을 작성 하면 된다.