Skip to content

Commit

Permalink
Merge pull request kookmin-sw#94 from capstone-maru/feat/chat-api
Browse files Browse the repository at this point in the history
feat: Add web socket URL
  • Loading branch information
cjeongmin authored May 21, 2024
2 parents 85b873b + bb1f795 commit e7e99c4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/FloatingChatting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function FloatingChattingBox() {
const initializeChat = async () => {
try {
const stomp = new Client({
brokerURL: `ws://ec2-54-180-133-123.ap-northeast-2.compute.amazonaws.com:8080/ws`,
brokerURL: `${process.env.NEXT_PUBLIC_CHAT_API_URL}`,
connectHeaders: {
Authorization: `Bearer ${auth?.accessToken}`,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/chat/ChattingRoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export function ChattingRoom({
const initializeChat = async () => {
try {
const stomp = new Client({
brokerURL: `ws://ec2-54-180-133-123.ap-northeast-2.compute.amazonaws.com:8080/ws`,
brokerURL: `${process.env.NEXT_PUBLIC_CHAT_API_URL}`,
connectHeaders: {
Authorization: `Bearer ${auth?.accessToken}`,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/chat/MobileChattingBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function MobileChattingBox() {
const initializeChat = async () => {
try {
const stomp = new Client({
brokerURL: `ws://ec2-54-180-133-123.ap-northeast-2.compute.amazonaws.com:8080/ws`,
brokerURL: `${process.env.NEXT_PUBLIC_CHAT_API_URL}`,
connectHeaders: {
Authorization: `Bearer ${auth?.accessToken}`,
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/chat/MobileChattingRoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export function MobileChattingRoom({
const initializeChat = async () => {
try {
const stomp = new Client({
brokerURL: `ws://ec2-54-180-133-123.ap-northeast-2.compute.amazonaws.com:8080/ws`,
brokerURL: `${process.env.NEXT_PUBLIC_CHAT_API_URL}`,
connectHeaders: {
Authorization: `Bearer ${auth?.accessToken}`,
},
Expand Down Expand Up @@ -263,7 +263,7 @@ export function MobileChattingRoom({
stompClient.publish({
destination,
body: JSON.stringify({
roomId: roomId,
roomId,
sender: user,
message: inputMessage,
nickname: userName,
Expand Down

0 comments on commit e7e99c4

Please sign in to comment.