목록2024/07 (3)
개발하는 감자
✅ 테스트 서버API 1차 개발 완료 후, 프론트 분들이 테스트와 함께 개발하실 수 있도록 테스트 서버를 만들어 달라는 요청을 받았다.많은 클라우드 서비스가 있지만, 시간이 없는 관계로 전에 한번 경험했던 EC2를 사용해 테스트 서버를 배포했다.( 그때의 수많은 시행착오를 기억하지 못했다.. ) 서버는 그냥 간단하게 EC2에 Nginx를 설치해 배포했고 80번 포트로 요청했을 때, spring 서버인 8080포트로 연결되도록 설정해 주었다. ✅ 과정, 시행착오1. 먼저, EC2를 만들고, ssh 를 통해 연결해 주었다.이 과정은 예전 수업 자료를 통해 해주었고, ssh 연결 도중WARNING UNPROTECTED PRIVATE KEY FILE권한이 너무 많이 열려있어 발생하는 에러로, 해당 블로그를 참고..
카카오 로그인 구현 도중, 액세스 토큰까지 발급이 다 완료된 상태인데 토큰을 통해 사용자 정보 조회하는 과정에서 401 에러가 계속해서 발생했다. 검색해 보면 해당 에러는 거의 api 호출 시 정보를 제대로 전송하지 않아 발생되는 에러였는데, 계속 확인해 봐도 HttpHeaders headers = new HttpHeaders();headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);headers.setBearerAuth(accessToken); 헤더에 정보를 제대로 잘 전달하고 있었다. - 카카오 로그인 API 토큰을 이용한 사용자 정보 조회 시 헤더에 담아 넘겨야 할 값 https://developers.kakao.com/docs/latest/..
✅ 필요성 & S3 변경 이유booker는 독서 활동을 기록하는 플랫폼으로 기획한 만큼 '사진'으로 하는 기록이 굉장히 중요한 플랫폼이다. 따라서 많은 양의 사진을 어떻게 저장하면 좋을지 고민하다가 클라우드 스토리지를 생각하게 되었다.처음 v3까지는 Google Cloud Platform을 사용했는데, 이번에 v4는 AWS로 배포를 하게 되면서 클라우드 스토리지 또한 S3로 변경하게 되었다. 따라서 spring과 S3 연결을 하는 과정들과 배운 것들을 기록해 보고자 한다. 🗄️ 버킷 생성생성은 해당 블로그를 참고하여 생성했다. 🍃 S3 with spring먼저 gradle에 해당 의존성을 추가해 줬다.implementation 'org.springframework.cloud:spring-cloud-..