Skip to content

Commit

Permalink
fix(*): fixed the socket connection string, build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shanmugharajk committed Mar 22, 2020
1 parent a2e4c79 commit 0e0903a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 186 deletions.
14 changes: 8 additions & 6 deletions packages/web/src/services/GameService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import {
} from "@rcg/common";
import * as io from "socket.io-client";

const ioClient: SocketIOClient.Socket = io(
document.location.protocol + "//" + document.location.host,
{
timeout: 200000
}
);
const ifDevelopment = process.env.NODE_ENV === "development";
const connection = ifDevelopment
? "http://localhost:4500/"
: document.location.protocol + "//" + document.location.host;

const ioClient: SocketIOClient.Socket = io(connection, {
timeout: 200000
});

class GameService {
/**
Expand Down
6 changes: 3 additions & 3 deletions packages/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"rootDir": "src",
"rootDir": "./",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"noUnusedLocals": true
},
"exclude": [
"node_modules",
Expand All @@ -29,4 +29,4 @@
"jest",
"src/setupTests.ts"
]
}
}
Loading

0 comments on commit 0e0903a

Please sign in to comment.