File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11NODE_ENV=development
2- API_URL =http://localhost:8081
2+ BASE_API_URL =http://localhost:8081
33BASE_SOCKET_URL=http://localhost:3001
Original file line number Diff line number Diff line change 11NODE_ENV=production
2- API_URL =http://localhost:8080
2+ BASE_API_URL =http://localhost:8080
33BASE_SOCKET_URL=http://localhost:3001
Original file line number Diff line number Diff line change 11import * as ioClient from 'socket.io-client';
22import { Socket } from 'socket.io';
3+ import { baseSocketUrl } from './const';
34
45export interface ConnectionSetup {
56 room: string;
@@ -9,7 +10,7 @@ export interface ConnectionSetup {
910export const createSocket = (connectionSetup: ConnectionSetup): Socket => {
1011 const { room, trainertoken } = connectionSetup;
1112 const socketParams = {
12- url: process.env.BASE_SOCKET_URL ,
13+ url: baseSocketUrl ,
1314 options: {
1415 query: { room, trainertoken },
1516 timeout: 60000,
Original file line number Diff line number Diff line change 1+ export const baseApiUrl = process.env.BASE_API_URL;
2+ export const baseSocketUrl = process.env.BASE_SOCKET_URL;
3+
14export const SocketOuputMessageLiteral = {
25 MESSAGE: 'message',
36};
Original file line number Diff line number Diff line change 11import Axios from 'axios';
2+ import { baseApiUrl } from 'core';
23
3- const getRoomUrl = `${process.env.API_URL }/api/create-room`;
4+ const getRoomUrl = `${baseApiUrl }/api/create-room`;
45
56interface SessionInfo {
67 room: string;
You can’t perform that action at this time.
0 commit comments