본문 바로가기

Spring34

[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.
[MySQL] MySQL 서버 실행 확인, 데이터베이스 생성 (+ MySQL Unknown database 해결) mysql database 실행 확인 netstat -an | grep 3306 mysql 서버 실행 mysql 접속 database 목록 확인 show databases; 데이터베이스 생성 create database test_db; 참고 : https://jerryjerryjerry.tistory.com/121 2022. 8. 31.
[Spring] spring 프로젝트 MySQL 연결하기 build.gradle dependencies 추가 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=true spring.datasource.username=test spring.datasource.password=1234 spr.. 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.
[Spring] inflearn 스프링 입문 - 프로젝트 환경설정 4 View 환경설정 1. Welcome Page 만들기 src > main > resources > static 에서 New > File 클릭 index.html 파일 생성 (Welcome Page) index.html Hello hello 서버를 껏다가 다시 실행 후 localhost:8080 에 접속 마우스 우클릭 후 페이지 소스 보기를 클릭하면 위에서 적은 html 코드 확인 가능 spring 많은 기능 가짐. 자바 웹 애플리케이션 개발 관련 전반의 생태계 제공. 방대함. 필요한 것 찾는 능력 중요! spring boot는 spring 생태계를 감싸서 편리하게 사용할 수 있도록 도와줌 2. Reference Documentation 검색 https://spring.io/ project > Spring.. 2022. 8. 28.