Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- BOJ1655
- KT포트포워딩
- java
- 딥러닝
- 백준온라인저지
- 백준스택
- 백준평범한배낭
- 컴퓨터비전
- 냅색알고리즘
- 윤곽선검출
- 백준10828
- 이것이자바다9장
- 코드트리
- 2019카카오코테
- 확인문제
- BOJ
- 백준9012
- 웹개발기초
- 합성곱연산
- 코테
- 이것이자바다확인문제
- 운영체제
- 가운데를말해요
- 백준
- 스파르타코딩클럽
- 코딩테스트실력진단
- 백준괄호
- 카카오코테
- 백준가운데를말해요
- 이것이자바다
Archives
- Today
- Total
코딩하는 락커
[Spring Boot를 이용한 RESTful Web Services 개발] 6~7강 본문
🍃 Spring/🌱 Spring Boot를 이용한 RESTful Web Service
[Spring Boot를 이용한 RESTful Web Services 개발] 6~7강
락꿈사 2022. 2. 4. 15:37스프링 설정 파일
Pom.xml : 전체 프로젝트에 필요한 Maven 설정을 지정하는 파일
application.properties : 스프링 설정을 할 수 있는 파일. (yml 파일로 변경함)
포트 번호 변경 (application.yml에 작성)
server:
port: 8088
간단한 Rest Controller 만들기
- com.example.restfulservice 패키지에 HelloWorldContoller.java 파일 생성
- GET 방식의 메소드 사용
- URI : /hello-world (URI는 사용자에 의해 호출되는 end-point)
- 기존방식은 @RequestMapping()을 썼지만 스프링 4.0이후로 어노테이션으로 바로 메소드 지정 가능해짐
@RequestMapping(method=RequestMethod.GET, path="/hello-word")
@GetMapping(path="/hello-world")
package com.example.restfulwebservice;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloWorldController {
@GetMapping(path = "/hello-world")
public String helloworld(){
return "Hello World";
}
}
'🍃 Spring > 🌱 Spring Boot를 이용한 RESTful Web Service' 카테고리의 다른 글
[Spring Boot를 이용한 RESTful Web Services 개발] 9~10강 (0) | 2022.02.05 |
---|---|
[Spring Boot를 이용한 RESTful Web Services 개발] 8강 (0) | 2022.02.04 |
[Spring Boot를 이용한 RESTful Web Services 개발] 5강 (0) | 2022.02.02 |
[Spring Boot를 이용한 RESTful Web Services 개발] 4강 (0) | 2022.02.02 |
[Spring Boot를 이용한 RESTful Web Services 개발] 3강 (0) | 2022.02.02 |
Comments