Skip to content

Commit

Permalink
Trying to get CORS configured
Browse files Browse the repository at this point in the history
  • Loading branch information
second-slip committed Sep 26, 2023
1 parent 9dfd33a commit 03fb887
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/app/contact-form/contact-form.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { IContactForm } from './i-contact-form.dto';

const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' })
};
// const httpOptions = {
// headers: new HttpHeaders({ 'Content-Type': 'application/json' })
// };

const url = 'https://birder-server.azurewebsites.net/api/message/send-contact-message'

Expand All @@ -17,6 +17,13 @@ export class ContactFormService {
constructor(private readonly _http: HttpClient) { }

public postContactForm(model: IContactForm): Observable<{ success: boolean }> {
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' })
};

httpOptions.headers.set("Access-Control-Allow-Origin", "*");


return this._http.post<{ success: boolean }>(url, model, httpOptions);
}
}

0 comments on commit 03fb887

Please sign in to comment.