Skip to content

Commit

Permalink
chore: Update all localhost references to production deployment URL
Browse files Browse the repository at this point in the history
  • Loading branch information
cussle committed Nov 14, 2024
1 parent b3a4dee commit 6cc7c5f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public Long extractUserIdFromSession(WebSocketSession session) {
* @return 해당 파라미터 값 (존재하지 않으면 null 반환)
*/
private Long extractParamFromUri(String uri, String paramName) {
// e.g. `ws://localhost:8080/ws?chatId=1&userId=1` 입력의 경우,
// e.g. `ws://3.34.144.148:8080/ws?chatId=1&userId=1` 입력의 경우,
try {
// "?"로 나누어 쿼리 파라미터 부분만 가져옴 (e.g. `chatId=1&userId=1`)
String[] parts = uri.split("\\?");
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spring.jpa.show-sql=true
#spring.datasource.url=jdbc:h2:mem:test;MODE=MYSQL;DB_CLOSE_DELAY=-1
#spring.datasource.username=sa
#spring.datasource.password=
spring.datasource.url=jdbc:mysql://localhost:3306/devcard_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC&characterEncoding=UTF-8
spring.datasource.url=jdbc:mysql://3.34.144.148:3306/devcard_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC&characterEncoding=UTF-8
spring.datasource.username=${DB_USERNAME}
spring.datasource.password=${DB_PASSWORD}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
Expand All @@ -37,7 +37,7 @@ logging.level.org.springframework.security=DEBUG


# QR Code Service
qr.domain.uri=http://localhost:8080/
qr.domain.uri=http://3.34.144.148:8080/
qr.code.directory=src/main/resources/static/qrcodes/

# Kakao Service
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/static/js/card/card-share.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ document.getElementById('kakao-share-btn').addEventListener('click', function ()
description: '회사: [[${card.company}]], 직책: [[${card.position}]]',
imageUrl: 'https://developers.kakao.com/assets/img/about/logos/kakaolink/kakaolink_btn_medium.png',
link: {
mobileWebUrl: 'http://localhost:8080/cards/' + cardId + '/view',
webUrl: 'http://localhost:8080/cards/' + cardId + '/view'
mobileWebUrl: 'http://3.34.144.148:8080/cards/' + cardId + '/view',
webUrl: 'http://3.34.144.148:8080/cards/' + cardId + '/view'
}
},
buttons: [
{
title: '명함 보기',
link: {
mobileWebUrl: 'http://localhost:8080/cards/' + cardId + '/view',
webUrl: 'http://localhost:8080/cards/' + cardId + '/view'
mobileWebUrl: 'http://3.34.144.148:8080/cards/' + cardId + '/view',
webUrl: 'http://3.34.144.148:8080/cards/' + cardId + '/view'
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/js/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ $(document).ready(function () {
fetchChatRoom(chatId);

// 임시로 로컬 서버 설정
const socket = new WebSocket(`ws://localhost:8080/ws?chatId=${chatId}&userId=${memberId}`);
const socket = new WebSocket(`ws://3.34.144.148:8080/ws?chatId=${chatId}&userId=${memberId}`);

// 웹소켓 연결
socket.addEventListener("open", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ void testExtractMessage_EmptyJsonObject() {
@DisplayName("유효한 chatId 추출 성공")
void testExtractChatIdFromSession_ValidChatId() {
// 유효한 URI 설정
when(session.getUri()).thenReturn(URI.create("ws://localhost:8080/ws?chatId=1&userId=1"));
when(session.getUri()).thenReturn(URI.create("ws://3.34.144.148:8080/ws?chatId=1&userId=1"));

// chatId가 1로 반환되는지 확인
Long chatId = chatService.extractChatIdFromSession(session);
Expand All @@ -381,7 +381,7 @@ void testExtractChatIdFromSession_ValidChatId() {
@DisplayName("쿼리 파라미터 없음 - chatId")
void testExtractChatIdFromSession_NoChatId() {
// chatId가 없는 URI 설정
when(session.getUri()).thenReturn(URI.create("ws://localhost:8080/ws"));
when(session.getUri()).thenReturn(URI.create("ws://3.34.144.148:8080/ws"));

// chatId가 없으므로 IllegalArgumentException 발생
Exception exception = assertThrows(
Expand All @@ -395,7 +395,7 @@ void testExtractChatIdFromSession_NoChatId() {
@DisplayName("chatId 숫자 형식 오류")
void testExtractChatIdFromSession_InvalidChatIdFormat() {
// chatId가 잘못된 형식인 URI 설정
when(session.getUri()).thenReturn(URI.create("ws://localhost:8080/ws?chatId=abc&userId=1"));
when(session.getUri()).thenReturn(URI.create("ws://3.34.144.148:8080/ws?chatId=abc&userId=1"));

// chatId가 숫자 형식이 아니므로 IllegalArgumentException 발생
Exception exception = assertThrows(
Expand All @@ -409,7 +409,7 @@ void testExtractChatIdFromSession_InvalidChatIdFormat() {
@DisplayName("유효한 userId 추출 성공")
void testExtractUserIdFromSession_ValidUserId() {
// 유효한 URI 설정
when(session.getUri()).thenReturn(URI.create("ws://localhost:8080/ws?chatId=1&userId=1"));
when(session.getUri()).thenReturn(URI.create("ws://3.34.144.148:8080/ws?chatId=1&userId=1"));

// userId가 1로 반환되는지 확인
Long userId = chatService.extractUserIdFromSession(session);
Expand All @@ -420,7 +420,7 @@ void testExtractUserIdFromSession_ValidUserId() {
@DisplayName("쿼리 파라미터 없음 - userId")
void testExtractUserIdFromSession_NoUserId() {
// userId가 없는 URI 설정
when(session.getUri()).thenReturn(URI.create("ws://localhost:8080/ws"));
when(session.getUri()).thenReturn(URI.create("ws://3.34.144.148:8080/ws"));

// userId가 없으므로 IllegalArgumentException 발생
Exception exception = assertThrows(
Expand All @@ -434,7 +434,7 @@ void testExtractUserIdFromSession_NoUserId() {
@DisplayName("userId 숫자 형식 오류")
void testExtractUserIdFromSession_InvalidUserIdFormat() {
// userId가 잘못된 형식인 URI 설정
when(session.getUri()).thenReturn(URI.create("ws://localhost:8080/ws?chatId=1&userId=abc"));
when(session.getUri()).thenReturn(URI.create("ws://3.34.144.148:8080/ws?chatId=1&userId=abc"));

// userId가 숫자 형식이 아니므로 IllegalArgumentException 발생
Exception exception = assertThrows(
Expand Down

0 comments on commit 6cc7c5f

Please sign in to comment.