๋ถ๋ฅ ์ ์ฒด๋ณด๊ธฐ199 [Spring Boot/RESTful] Spring Boot๋ก ๊ฐ๋ฐํ๋ RESTful Service ํ๋ก์ ํธ ์์ฑ ์ง๊ธ๊น์ง๋ ํญ์ start.spring.io๋ฅผ ์ด์ฉํด์๋๋ฐ, IntelliJ ์์์ ๋ฐ๋ก ํ๋ก์ ํธ๋ฅผ ์์ฑํ ์๋ ์๋ค! ์๋์ฒ๋ผ dependency๋ฅผ ์ถ๊ฐํ๋ฉด pom.xml์ ์๋์ผ๋ก ์ถ๊ฐ๋๋ค. Spring web → embedded tomcat ์คํ ๊ฐ๋ฅ REST API ์ค๊ณ HTTPS API Name GET /users retrieve all users POST /users create a user GET /users/{id} retrieve one user DELETE /users/{id} delete a user GET /users/{id}/posts retrieve all posts for a user POST /users/{id}/posts create a post for a u.. 2022. 2. 17. [Spring Boot/RESTful] Web Service & Web Application ์น ์๋น์ค ๋คํธ์ํฌ ์์์ ์๋ก ๋ค๋ฅธ ์ข ๋ฅ์ ์ปดํจํฐ๋ค ๊ฐ์ ์ํธ์์ฉํ๊ธฐ ์ํ ์ํํธ์จ์ด ์์คํ SOAP VS REST 1) SOAP(Simple object access protocol) XML ๊ธฐ๋ฐ envelope - header - body๋ก ๊ตฌ์ฑ๋์ด ์์ -> overhead ์ฌํจ 2) REST(REpresentational State Transfer) Resource์ representation์ ์ํ (์์์) ์ํ ์ ๋ฌ HTTP Method๋ฅผ ํตํด Resource๋ฅผ ์ฒ๋ฆฌํ๊ธฐ ์ํ ์ํคํ ์ณ RESTful : REST API๋ฅผ ์ ๊ณตํ๋ ์น ์๋น์ค REST HTTP HTTP Methods : ํด๋ผ์ด์ธํธ๊ฐ ์๋ฒ์๊ฒ ์ ๋ฌํ๊ฒ ๋๋ ๋ชฉ์ ์ด๋ ์ข ๋ฅ๋ฅผ ์๋ ค์ฃผ๋ ์๋จ HTTP Status Codes : ํด๋ผ์ด.. 2022. 2. 17. [Error] Spring Boot(2.5x)์์ data.sql ์คํ ์ค๋ฅ(H2 database) ์ํฉ Spring Boot(2.5 ์ด์)์์ data.sql์ ์คํํ์์ผ๋ h2 db์ ํด๋น ์ฟผ๋ฆฌ๊ฐ ๋ฐ์๋์ง ์์ ๊ฒฝ์ฐ.(ํ ์ด๋ธ์ ์ ์์ ์ผ๋ก ์์ฑ๋จ) ํด๊ฒฐ application.yml์ ์๋ ๋ ์ค ์ถ๊ฐํ๊ธฐ. ๋ค๋ฅธ ํฌ์คํ ์ ๋ณด๋ฉด defer-datasource-initialization์ true๋ก๋ง ํด๋ ๋์๊ฐ๋ค๊ณ ํ๋๋ฐ, ๋๊ฐ์ ๊ฒฝ์ฐ sql.init.mode=always๋ฅผ ์ถ๊ฐ์ ์ผ๋ก ๋ฃ์ด์ผ ์ ์์ ์ผ๋ก ์๋ํ๋ค! sql: init: mode: always jpa: defer-datasource-initialization: true 2022. 2. 2. [Error] H2 ์ถ๊ฐ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์์ฑ - IO Exception: null [90028-200] ์ํฉ H2 Database Engine์ ํตํด ์๋ก์ด H2 ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ๋ง๋๋ ค๊ณ ํ์ ๋ ๋ฐ์ํ๋ ์ค๋ฅ. path, username, password๋ฅผ ์ฌ๋ฐ๋ฅด๊ฒ ๋ฃ์๋๋ฐ๋ ๋ถ๊ตฌํ๊ณ ๋ฐ์. ํด๊ฒฐ ./{dbname}์ ~/{dbname}์ผ๋ก ๋ฐ๊พธ์ด์ฃผ์๋๋ ๋ฐ๋ก ์์ฑ๋์๋ค. ๊ทธ๋ฌ๋ ์๋๋ผ๋ฉด ~/{dbname}๊ณผ ./{dbname} ๋ชจ๋ ์์ฑ์ด ์ ๋์ด์ผ ํ๋ ๊ฒ์ด ๋ง๋ค. ์ฐจ์ด ~/ : user ํด๋์ ์์ฑ ./ : h2 bin ํด๋์ ์์ฑ ๋น๋ฐ๋ฒํธ ์์ ํ๋ ๋ฒ ALTER USER {์ ์ ๋ช } SET PASSWORD '(๋ณ๊ฒฝ๊ฐ)'; 2022. 1. 30. ์ด์ 1 ยทยทยท 21 22 23 24 25 26 27 ยทยทยท 50 ๋ค์