package com.example.newprojects.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController //해당 Class는 REST API를 처리하는 Controller
@RequestMapping("/api") //RequestMapping URI를 지정해주는 Annotation
public class ApiController {
@GetMapping("/hello") //http://localhost:8080/api/hello 주소설정 Annotation:@GetMapping
public String hello(){
return "hello spring boot!";
}
}
POST API (0) | 2022.08.16 |
---|---|
Get API (0) | 2022.08.16 |
스프링 부트 란? (0) | 2022.08.04 |
HTTP Protocol (0) | 2022.08.04 |
URI 설계 패턴 (0) | 2022.08.04 |