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) { 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: