diff --git a/package.json b/package.json index a4d82c1a25dbf1701e7b4edd01c3da3bb89282c3..a14bd54c9071c98019243abf622327d27e861bd1 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "license": "MIT", "scripts": { "ng": "ng", - "start": "ng serve", + "start": "ng serve --proxy-config proxy.conf.json", "build": "ng build --prod", "test": "ng test", "lint": "ng lint", diff --git a/proxy.conf.json b/proxy.conf.json new file mode 100644 index 0000000000000000000000000000000000000000..c2e9c8823311057960824399f18aafc86f7620a9 --- /dev/null +++ b/proxy.conf.json @@ -0,0 +1,10 @@ +{ + "/api": { + "target": "http://localhost:8080", + "secure": false, + "pathRewrite": { + "^/api": "" + }, + "logLevel": "debug" + } +} diff --git a/src/app/services/http/authentication.service.ts b/src/app/services/http/authentication.service.ts index 6de00a2b44b7b3fbb1a4105880616ad94df02a41..0e5957249e37ad58eb2d2b384d971057b8b5eeb8 100644 --- a/src/app/services/http/authentication.service.ts +++ b/src/app/services/http/authentication.service.ts @@ -13,8 +13,8 @@ export class AuthenticationService { private readonly STORAGE_KEY: string = 'USER'; private user = new BehaviorSubject<User>(undefined); private apiUrl = { - base: 'https://arsnova-staging.mni.thm.de/api', - v2: 'https://arsnova-staging.mni.thm.de/api/v2', + base: '/api', + v2: '/api/v2', auth: '/auth', login: '/login', user: '/user', diff --git a/src/app/services/http/comment.service.ts b/src/app/services/http/comment.service.ts index ee399e111b6bb79721de7e8254fa2081429ae143..7d8b0e74aac5a5fae363397e104139d0a53678dd 100644 --- a/src/app/services/http/comment.service.ts +++ b/src/app/services/http/comment.service.ts @@ -12,7 +12,7 @@ const httpOptions = { @Injectable() export class CommentService extends BaseHttpService { private apiUrl = { - base: 'https://arsnova-staging.mni.thm.de/api', + base: '/api', comment: '/comment', find: '/find' }; diff --git a/src/app/services/http/content-answer.service.ts b/src/app/services/http/content-answer.service.ts index 0a0ff4b7bb611fbd8a808c4a9d1867428cac15a9..a0d3a9aeb8bc565b2ec1685a0d168bcd36972047 100644 --- a/src/app/services/http/content-answer.service.ts +++ b/src/app/services/http/content-answer.service.ts @@ -13,7 +13,7 @@ const httpOptions = { @Injectable() export class ContentAnswerService extends BaseHttpService { private apiUrl = { - base: 'https://arsnova-staging.mni.thm.de/api', + base: '/api', answer: '/answer', text: '/text', choice: '/choice', diff --git a/src/app/services/http/content.service.ts b/src/app/services/http/content.service.ts index 99214619672ab696c69874b63ce4b17000412950..0ab298dd540b0852cd5c2ddddce4e62bba8129aa 100644 --- a/src/app/services/http/content.service.ts +++ b/src/app/services/http/content.service.ts @@ -13,7 +13,7 @@ const httpOptions = { @Injectable() export class ContentService extends BaseHttpService { private apiUrl = { - base: 'https://arsnova-staging.mni.thm.de/api', + base: '/api', content: '/content', find: '/find' }; diff --git a/src/app/services/http/room.service.ts b/src/app/services/http/room.service.ts index 810bdb6b1fbb9b146bb0208acfe531728bc339cf..251826004762612306c880369b85c15e723bf8d8 100644 --- a/src/app/services/http/room.service.ts +++ b/src/app/services/http/room.service.ts @@ -13,7 +13,7 @@ const httpOptions = { @Injectable() export class RoomService extends BaseHttpService { private apiUrl = { - base: 'https://arsnova-staging.mni.thm.de/api', + base: '/api', rooms: '/room', user: '/user', findRooms: '/find'