분류 전체보기 (406) 썸네일형 리스트형 Webpack5 - build시 css 파일 분리하기 1. 패키지 다운 npm install mini-css-extract-plugin --save-dev '--save-dev' 는 개발시에만 사용한다는 의미다.만약 선언하지 않고 받으면 npm run build 시devDependencies, dependencies 중 dependencies에 포함된다. runtime 때는 필요가 없으니 제외시킨다. 다시 말해서 build time 때만 css를 따로 뽑아주는 플러그인이 필요하니devDependencies에 포함되어야 한다. 2. webpack.config.js 설정// can't use ecma script module. use only common.jsconst path = require('path');const TerserPlugin = requir.. react - og tag 생성 후 체크 1. 메타태그 생성 index.html메타태그에 open graph의 약자인 og 태그를 생성합니다. [index.html] 2. 각 메타태그 내용og:title -> 제목og:description -> og태그 설명란og:image -> 대표이미지 og:url -> url Spring boot 3 - Thymeleaf 핫리로드까지는 아니지만 리로드시 적용시키기 [application.yml]spring: thymeleaf: # Thymeleaf cache: false mode: HTML encoding: UTF-8 prefix: file:src/main/resources/templates/ resources: # Static resources static-locations: file:src/main/resources/static/ cache: period: 0 캐시설정을 끄면 된다...! Spring boot3 - h2 설정해서 쓰기, 스키마 쿼리 셋팅 후 datasource를 이용해 미리 h2에 테이블 생성하기 1. 라이브러리 가져오기 (생략) com.h2database h2 runtime (생략) 2. 서버 실행하기실행 후 로그에 특정 주소가 나온다jdbc부터 끝까지 복사 한다. ex) jdbc:h2:mem:11270f92-a5f8-4cf5-a8c7-e1f8388876b3 3. h2 사용한다는 내용 설정하기 [application.properties]spring.h2.console.enabled=true 4. h2 콘솔 진입하여 접속하기 http://localhost:8080/h2-console 접속 완료 위 처럼 로그 보면서 하면 힘드니 Schema를 서버 실행시 미리 생성해놓자 1. 실행시 testdb라는 이름으로 데이터베이스 생성할 수 있도록 설정[application.propert.. Spring boot3 - Spring Actuator 사용하여 health check 하기 1. 라이브러리 가져오기 org.springframework.boot spring-boot-starter-actuator 2. application.properties에 보고 싶은 server 내용 넣기management.endpoints.web.exposure.include=health,metrix#혹은 전부 보고싶을 때는 아래 처럼 설정#management.endpoints.web.exposure.include=* 3. 접속해서 확인하기 기본은 주소는http://도메인/actuator 만약 configProps에 대해 보고싶다면http://도메인/actuator/configProps 서버 요청에 대한 서버 값을 보고싶다면 http://localhost:8080/actuator/.. Spring boot3 - maven으로 빌드, 내장 tomcat은 어디있는지 확인하기 1. 메이븐으로 빌드하기./mvnw clean install target 프로젝트 아래에[프로젝트명].jar 파일로 생성되었을 것이다. 2. jar파일 실행하기 java -jar [프로젝트명].jar 3.내장 톰캣 위치 확인해보기내장톰캣과 함께 jar로 묶여서 올라간다.부트가 아닌 Spring을 사용했을 때는 Tomcat을 설치하여 톰캣 내에 war파일로 특정 디렉토리에 넣으면알아서 압축해제가 되고 서버에 실렸다. 지금은 내장톰캣을 사용하는데내장 톰캣은 언제 가져온걸까? pom.xml을 보자 컨트롤 누른 채 해당 디펜덴시 클릭하면 spring-boot-starter-web이 의존하고 있는데또 다른 디펜덴시를 볼 수 있다. 컴파일 시점에 사용하는tomcat 디펜덴시를 확인할 수 있다. Spring boot3 - properties에 있는 환경변수를 bean으로 등록해 사용해보기 1. properties에 환경변수 등록 currency에 관한 데이터를 환경변수로 등록하기 [application.properties]spring.application.name=learn-spring-bootlogging.level.org.springframework=debugspring.profiles.active=devcurrency-service.url=http://deafult.api.comcurrency-service.username=tomhooncurrency-service.key=1234 [application-dev.properties]spring.application.name=learn-spring-bootlogging.level.org.springframework=debugcurren.. Spring boot 3 - application.properties dev,prod,default 설정 사전에 spring-boot-devtools 라이브러리가 있어야함. 1. application-[환경].properties 파일 생성- application-dev.properties- application-prod.properties- application.properties [application.properties]logging.level.org.springframework=debugspring.profiles.active=dev [application-dev.properties]logging.level.org.springframework=debug [application-prod.properties]logging.level.org.springframework=info application.prop.. 이전 1 ··· 9 10 11 12 13 14 15 ··· 51 다음