Skip to content

Commit 90908c2

Browse files
committed
Use same port for backend - if current port not 4200
1 parent b90e7e9 commit 90908c2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,11 @@ Possibility to change the role:
7676
UPDATE User
7777
SET role = 'MAINTAINER'
7878
WHERE username = {username};
79+
80+
## Development
81+
82+
We needed to change the `basePath` in `DefaultApi.ts` as follows
83+
84+
protected basePath = location.protocol + '//' + location.hostname + ':' + location.port === '4200' ? '8080' : location.port);
85+
86+
In case you regenerate `DefaultApi.ts`, please patch this line.

frontend/src/app/gen/api/DefaultApi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import { Configuration } from '../configurat
2828
@Injectable()
2929
export class DefaultApi {
3030

31-
protected basePath = 'http://localhost:8080';
31+
protected basePath = location.protocol + '//' + location.hostname + ':' + (location.port === '4200' ? '8080' : location.port);
32+
3233
public defaultHeaders: Headers = new Headers();
3334
public configuration: Configuration = new Configuration();
3435

0 commit comments

Comments
 (0)