LOCAL
This commit is contained in:
parent
2bb12bfc2b
commit
81e175985d
4 changed files with 10 additions and 9 deletions
|
@ -3,10 +3,9 @@ WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install --legacy-peer-deps # or yarn install
|
RUN npm install --legacy-peer-deps # or yarn install
|
||||||
COPY . .
|
COPY . .
|
||||||
ARG IN_CLUSTER=true
|
ARG LOCAL=false
|
||||||
RUN if [ "$IN_CLUSTER" = "true" ]; then \
|
RUN if [ "$LOCAL" = "true" ]; then \
|
||||||
cp src/environments/environment.cluster.ts src/environments/environment.ts; \
|
cp src/environments/environment.local.ts src/environments/environment.ts; \
|
||||||
cp src/environments/environment.cluster.ts proof/environment.ts; \
|
|
||||||
fi
|
fi
|
||||||
RUN npm run build --prod
|
RUN npm run build --prod
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { environment } from '../enviroments/environment.cluster';
|
import { environment } from '../enviroments/environment';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class JumpService {
|
export class JumpService {
|
||||||
|
|
||||||
private apiUrl = environment.apiBaseUrl === ''
|
private apiUrl = environment.apiBaseUrl;
|
||||||
? 'http://localhost:8080/game/jump'
|
|
||||||
: environment.apiBaseUrl;
|
|
||||||
|
|
||||||
constructor(private http: HttpClient) {}
|
constructor(private http: HttpClient) {}
|
||||||
|
|
||||||
|
|
4
src/enviroments/environment.local.ts
Normal file
4
src/enviroments/environment.local.ts
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
export const environment = {
|
||||||
|
production: true,
|
||||||
|
apiBaseUrl: 'http://localhost:8080/game/jump'
|
||||||
|
};
|
|
@ -1,4 +1,4 @@
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: true,
|
production: true,
|
||||||
apiBaseUrl: 'http://silly-game-service.silly-game.svc.cluster.local'
|
apiBaseUrl: 'http://silly-game-service.silly-game.svc.cluster.local/game/jump'
|
||||||
};
|
};
|
Loading…
Reference in a new issue