본문 바로가기
Spring

스프링 부트를 이용해 웹서버 구축하기

by holy season 2023. 1. 30.
반응형

스프링을 시작하기 전 준비 사항

Intergrated Developer Environment(IDE)

 

Visual Studio Code - Code Editing. Redefined

Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.  Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows.

code.visualstudio.com

 

The Community for Open Innovation and Collaboration | The Eclipse Foundation

The Eclipse Foundation provides our global community of individuals and organizations with a mature, scalable, and business-friendly environment for open source …

www.eclipse.org

 

IntelliJ IDEA – Java 및 Kotlin을 위한 최고의 IDE

 

www.jetbrains.com

A Java Developement kit (JDK)

 

Download OpenJDK builds of Liberica JDK, Java 8, 11, 17, 19 | BellSoft Java

Liberica JDK is a free and open source Java Development Kit produced by BellSoft. It has been verified by TCK for Java SE specs and supports most Linux distributions (including Alpine Linux), Windows, macOS, Solaris. The Liberica OpenJDK package with the H

bell-sw.com

나의 개발 환경

  • Visual Studio Code
  • OpenJDK 19 (jdk-19.0.1)

스프링 부트 프로젝트 시작하기

https://start.spring.io/

Spring initializr

Project : Maven

Language : Java

Spring Boot : 3.0.2

Project Metadata

  • Java : 19

Dependencies 

  • Spring Web 

설정 후 GENERATE 생성된 파일을 압축 해제한 후 IDE로 폴더 열기

DemoApplication.java

다음과 같이 코드 작성 후 DemoApplication.java 실행

코드 작성한 DemoApplication.java

http://localhost:8080/hello로 접속한 화면

접속 화면

http://localhost:8080/hello?name=holy_season 으로 접속한 결과

http 요청에 name=holy_season을 넣은 결과

 

참고 사이트[https://spring.io/quickstart]

반응형