Skip to content

Commit

Permalink
fix(example-server): adding ability to override the environment
Browse files Browse the repository at this point in the history
  • Loading branch information
rallieon committed Sep 19, 2021
1 parent df9f5f6 commit 9f2cb0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/haste-game-server/.env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ HASTE_CLIENT_SECRET=
HASTE_API_PROTOCOL=http
HASTE_API_HOST=localhost
HASTE_API_PORT=3000
HASTE_ENVIRONMENT=nonproduction
6 changes: 5 additions & 1 deletion packages/haste-game-server/src/server/socketServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export class SocketServer {
host: process.env.HASTE_API_HOST,
port: parseInt(process.env.HASTE_API_PORT, 10),
accessToken: '',
environment: 'nonproduction',
environment: process.env.HASTE_ENVIRONMENT
? process.env.HASTE_ENVIRONMENT === 'production'
? 'production'
: 'nonproduction'
: 'nonproduction',
});

const gameEngine = new GameEngine(socket, this.haste);
Expand Down

0 comments on commit 9f2cb0d

Please sign in to comment.