본문 바로가기

Spring35

[Spring] inflearn 스프링 입문 - 스프링 웹 개발 기초 1 웹 개발 방법 3가지 정적컨텐츠 : 서버에서 하는 것 없이 파일을 그대로 웹브라우저(client)에 내려주는 것. MVC와 템플릿 엔진 : 가장 많이 하는 방식. jsp, php (템플릿 엔진 : 서버에서 프로그래밍해서 html을 동적으로 바꿔서 내림.) 이것을 하기 위해 controller, model, 템플릿 엔진 화면 (model, view, controller ) MVC 필요로 함. API : ios, android client 와 개발 시 서버입장에서 json 데이터 구조 포맷으로 client에 데이터 전달. 내려줌. 정적컨텐츠 스프링부트에서 정적컨텐츠 기능 기본적으로 제공 https://docs.spring.io/spring-boot/docs/current/reference/html/web.h.. 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.
[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.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.