diff --git a/src/app/core/session.service.ts b/src/app/core/session.service.ts index 2627624..6b664db 100644 --- a/src/app/core/session.service.ts +++ b/src/app/core/session.service.ts @@ -44,12 +44,12 @@ export class SessionService { this.loading = true; let server = this.configService.get('server'); - if(!server) { - server = 'https://openaccounting.io:8080/api'; + if(!server || server === 'https://openaccounting.io:8080/api') { + server = 'https://api.openaccounting.io'; this.configService.put('server', server); } - this.apiService.setUrl(server || 'https://openaccounting.io:8080/api'); + this.apiService.setUrl(server); sessionId = sessionId || this.configService.get('sessionId'); @@ -104,7 +104,7 @@ export class SessionService { } // initialize websocket - let matches = server.match(/\/\/(.+?)\//); + let matches = server.match(/\/\/([^\/]+)/); if(matches[1]) { let url = 'wss://' + diff --git a/src/app/shared/config.ts b/src/app/shared/config.ts index dbac45f..7cd7b99 100644 --- a/src/app/shared/config.ts +++ b/src/app/shared/config.ts @@ -5,7 +5,7 @@ export class Config { defaultOrg: string; reportData: any; constructor(options: any = {}) { - this.server = options.server || 'https://openaccounting.io:8080/api'; + this.server = options.server || 'https://api.openaccounting.io'; this.email = options.email; this.password = options.password; this.defaultOrg = options.defaultOrg;