Skip to content

Commit d7aa4c0

Browse files
committedJan 27, 2022
Add enviroment for services
1 parent 6c475e9 commit d7aa4c0

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed
 

‎src/app/services/bingo/bingo.service.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Injectable } from '@angular/core';
22
import { BehaviorSubject } from 'rxjs';
33
import { io } from "socket.io-client";
44

5+
import { environment } from '../../../environments/environment';
6+
57
@Injectable({
68
providedIn: 'root'
79
})
@@ -13,7 +15,7 @@ export class BingoService {
1315

1416
constructor() { }
1517

16-
socket = io('http://localhost:3000');
18+
socket = io(environment.server);
1719

1820
public sendMessage(message: String) {
1921
this.socket.emit('message', message);

‎src/environments/environment.prod.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export const environment = {
2-
production: true
2+
production: true,
3+
server: 'https://nodejs-bingo.herokuapp.com'
34
};

‎src/environments/environment.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// The list of file replacements can be found in `angular.json`.
44

55
export const environment = {
6-
production: false
6+
production: false,
7+
server: 'http://localhost:3000'
78
};
89

910
/*

0 commit comments

Comments
 (0)