Skip to content

Commit

Permalink
calling register endpoint by https
Browse files Browse the repository at this point in the history
  • Loading branch information
l-brendle committed Oct 22, 2023
1 parent 4760160 commit 2d6e4fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion angular-frontend/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const environment = {
production: true,
backend: {
host: window.location.host,
protocol: "wss"
protocol: "wss",
protocolHttp: "https"
}
};
3 changes: 2 additions & 1 deletion angular-frontend/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const environment = {
production: false,
backend: {
host: "localhost:8080",
protocol: "ws"
protocol: "ws",
protocolHttp: "http"
}
};
4 changes: 3 additions & 1 deletion angular-frontend/src/http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import {Injectable} from "@angular/core";
export class HttpService {
host: String;
protocol: String;
protocolHttp : String;

constructor(private http: HttpClient) {
this.host = environment.backend.host;
this.protocol = environment.backend.protocol;
this.protocolHttp = environment.backend.protocolHttp;
}

getWebSocket(credentials: Credentials): WebSocket {
Expand All @@ -20,7 +22,7 @@ export class HttpService {
}

getRegistrationURL(credentials : Credentials) : Observable<boolean> {
return this.http.post<boolean>(`http://${this.host}/api/user/registration`, credentials)
return this.http.post<boolean>(`${this.protocolHttp}://${this.host}/api/user/registration`, credentials)
}

}

0 comments on commit 2d6e4fc

Please sign in to comment.