From 9b8ff6f5851430c325d602f23ec70c1352625005 Mon Sep 17 00:00:00 2001 From: Ayuukina <60597271+Ayuukina@users.noreply.github.com> Date: Tue, 14 Feb 2023 13:39:23 +0100 Subject: [PATCH 1/2] mon pull de fou --- pw/pw-jwt-oauth/client/src/app/services/newsService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pw/pw-jwt-oauth/client/src/app/services/newsService.ts b/pw/pw-jwt-oauth/client/src/app/services/newsService.ts index 03195f0d..a0220feb 100644 --- a/pw/pw-jwt-oauth/client/src/app/services/newsService.ts +++ b/pw/pw-jwt-oauth/client/src/app/services/newsService.ts @@ -9,7 +9,10 @@ export class NewsService { constructor(private http: HttpClient) {} getNews(): Observable { - return this.http.get('/api/news'); + let headers= new HttpHeaders({'Content-Type': 'application/json'}); + let _url_ = 'http://localhost:8080/api/news'; + return this.http.get(_url_, {headers: headers}) + //return this.http.get('/api/news'); } addLike(news: News) { From 995338e254584ea8578d0062e552e20cd9128f31 Mon Sep 17 00:00:00 2001 From: Lucas-Z-ok Date: Tue, 14 Feb 2023 13:51:42 +0100 Subject: [PATCH 2/2] Update application.yml --- .../src/main/resources/config/application.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pw/pw-jwt-oauth/server/src/main/resources/config/application.yml b/pw/pw-jwt-oauth/server/src/main/resources/config/application.yml index bce710c9..39b1d7d9 100644 --- a/pw/pw-jwt-oauth/server/src/main/resources/config/application.yml +++ b/pw/pw-jwt-oauth/server/src/main/resources/config/application.yml @@ -71,13 +71,13 @@ jhipster: max-pool-size: 50 queue-capacity: 10000 # By default CORS is disabled. Uncomment to enable. - #cors: - #allowed-origins: "*" - #allowed-methods: GET, PUT, POST, DELETE, OPTIONS - #allowed-headers: "*" - #exposed-headers: - #allow-credentials: true - #max-age: 1800 + cors: + allowed-origins: http://localhost:9000 + allowed-methods: GET, PUT, POST, DELETE, OPTIONS + allowed-headers: "*" + exposed-headers: + allow-credentials: true + max-age: 1800 mail: from: bookstore@localhost ribbon: