From 00567ce72b8635e132e0b334e96f84fb3768b67a Mon Sep 17 00:00:00 2001 From: simon987 Date: Sun, 24 Feb 2019 17:47:37 -0500 Subject: [PATCH] Dynamic api url --- jenkins/deploy.sh | 2 +- web/angular/src/app/api.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins/deploy.sh b/jenkins/deploy.sh index 7b23f0d..b40c822 100755 --- a/jenkins/deploy.sh +++ b/jenkins/deploy.sh @@ -6,6 +6,6 @@ chmod 755 -R "${TTROOT}/webroot" screen -S tt_api -X quit echo "starting client" -screen -S tt_api -d -m bash -c "cd ${TTROOT} && ./tt_api" +screen -S tt_api -d -m bash -c "cd ${TTROOT} && chmod +x tt_api && ./tt_api" sleep 1 screen -list diff --git a/web/angular/src/app/api.service.ts b/web/angular/src/app/api.service.ts index df55562..f0fca8d 100755 --- a/web/angular/src/app/api.service.ts +++ b/web/angular/src/app/api.service.ts @@ -6,7 +6,7 @@ import {Credentials} from "./models/credentials"; @Injectable() export class ApiService { - public url: string = "http://localhost/api"; + public url: string = window.location.protocol + "//" + window.location.hostname + "/api"; private options: { withCredentials: true, responseType: "json"