안녕하세요. hia의 개발 story입니다.
프로젝트의 가장 기본으로 Hello World 페이지를 만들어서 index 파일이 잘 읽히는지 확인하려고 합니다.
스프링 부트에서는 기본적으로 welcome page를 지원해줍니다.
공식 문서에서 보이듯이 파일명을 index로 설정하면 자동으로 welcome page로 인식을 합니다.
정확히는 프로젝트 실행 시에 스프링 부트에서 가장 먼저 index를 찾아서 가죠.
Spring Boot Features
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
그러면 이제 intellij에서 처음으로 html 파일을 만들어 보겠습니다.
index 파일 위치는 static 으로 위치해주면 됩니다.
Command + N 을 누르고 html 파일을 찾아서 index로 만들어줍니다.
만들어진 index 파일이 잘 실행되는지 확인하기 위해서 간단하게 Hello World!! 를 띄워보도록 하겠습니다.
<h1>hello world!!</h1>을 body 안에 적어줍니다.
저장을 하고 재실행을 하고 localhost에 접속하면 아래 화면처럼 hello world가 잘 보이게 됩니다.
'Springboot' 카테고리의 다른 글
[Spring Boot] MariaDB와 Spring JPA 사용하기 (0) | 2023.03.14 |
---|---|
[Spring Boot] header 메뉴 선택 시 jquery로 class 값 변경하기 (0) | 2022.12.22 |
[Spring Boot] Thymeleaf를 이용한 header, footer 등 공통 페이지 조각 만들기 (0) | 2022.12.14 |
[Spring Boot] 무료 템플릿을 이용한 홈페이지 제작 (0) | 2022.12.07 |
[Spring Boot] Intellij에 스프링 부트 프로젝트 생성하기 (0) | 2022.11.26 |