Spring17 [Spring] SpringBoot + AWS RDS + React 연동하기 SpringBoot 2022.09.01 - [aws] - [RDS] SpringBoot 와 RDS 연동하기 React App.js > App const [member, setMember] = useState([]); useEffect(() => { fetch("/member/select") .then((res) => { return res.json(); }) .then((data) => { setMember(data); }); }, []); App.js > App > return {member.map((v, idx) => ( id: {v.id}, name : {v.name}, password : {v.password} ))} spring 프로젝트 실행, npm start 후 localhost:3000 확인 2022. 9. 2. [Spring + React] 스프링과 리액트 연동하기 Spring HelloController.java package com.sto.salepurchase.backstosalepurchase; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Arrays; import java.util.List; @RestController public class HelloController { @GetMapping("hello") public List Hello(){ return Arrays.asList("서버 포트는 8080", "리액트 포트는 3000"); } } main.. 2022. 8. 31. [Spring] spring 프로젝트 MySQL 연결하기 build.gradledependencies 추가 application.properties 설정 추가# MySQL 설정spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver# JDBC URL of the database.# spring.datasource.url=jdbc:mysql://localhost:{port}/{DBname}?{options}spring.datasource.url=jdbc:mysql://localhost:3306/test_db?useSSL=false&allowPublicKeyRetrieval=truespring.datasource.username=testspring.datasource.password=1234spring.jpa.d.. 2022. 8. 31. [Spring] intellij build.gradle dependencies 추가하기 dependencies 에서 마우스 우클릭, Generate 클릭 Add dependency 추가할 dependency 검색 후 add Load Gradle Changes 참고 : https://velog.io/@dnwlsrla40/Intellij-intellij%EC%97%90%EC%84%9C-%EB%B0%94%EB%A1%9C-dependency-%EC%B6%94%EA%B0%80 2022. 8. 31. [Spring] STO-sale-purchase 프로젝트 환경설정 프로젝트 생성 Backend https://start.spring.io/ GENERATE build.gradle open (intellij) STO-sale-purchase/back-sto-sale-purchase/src/main/java/com/sto/salepurchase/backstosalepurchase/BackStoSalePurchaseApplication.java main method 실행 localhost:8080 접속 Frontend npx create-react-app front-sto-sale-purchase cd front-sto-sale-purchase npm start 2022. 8. 29. 이전 1 2 3 다음