forked from tykayn/funky-framadate-front
default backend to framadate demo api
This commit is contained in:
parent
e61542b652
commit
b2b8056b7e
@ -21,7 +21,6 @@ const apiEndpoints = environment.api.endpoints;
|
||||
})
|
||||
export class ApiService {
|
||||
private static loader: LoaderService;
|
||||
private http: HttpClient;
|
||||
private useDevLocalServer = true;
|
||||
private devLocalServerBaseHref = 'http://localhost:8000/';
|
||||
private axiosInstance: AxiosInstance;
|
||||
@ -117,9 +116,9 @@ export class ApiService {
|
||||
|
||||
console.log('vote_stack', vote_stack);
|
||||
console.log('this.baseHref', this.baseHref);
|
||||
let headers = ApiService.makeHeaders();
|
||||
let headers = ApiService.makeHeaders(vote_stack);
|
||||
console.log('headers', headers);
|
||||
let url = `${this.baseHref}/${poll.custom_url}/answer`;
|
||||
let url = `${this.baseHref}/poll/${poll.custom_url}/answer`;
|
||||
|
||||
let axiosconf = {
|
||||
url,
|
||||
@ -128,7 +127,14 @@ export class ApiService {
|
||||
headers,
|
||||
};
|
||||
|
||||
return this.http.post(url, vote_stack, headers);
|
||||
return this.http.post(url, vote_stack, {
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Content-Type': 'application/json',
|
||||
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
|
||||
'Access-Control-Allow-Headers': 'Accept,Accept-Language,Content-Language,Content-Type',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
//////////
|
||||
|
@ -2,7 +2,6 @@
|
||||
<section class="poll_loaded padded" *ngIf="!fetching && poll">
|
||||
<div class="well debug">
|
||||
<!-- infos locales storage-->
|
||||
debug: {{ storageService.vote_stack | json }}
|
||||
</div>
|
||||
|
||||
<!-- messages-->
|
||||
|
@ -4,10 +4,12 @@
|
||||
|
||||
const backendApiUrlsInDev = {
|
||||
local: '/api/v1',
|
||||
remote: 'http://localhost:8000/api/v1',
|
||||
// remote: 'http://localhost:8000/api/v1',
|
||||
remote: 'https://framadate-api.cipherbliss.com/api/v1',
|
||||
};
|
||||
const apiV1 = {
|
||||
baseHref: 'http://localhost:8000/api/v1',
|
||||
// baseHref: 'http://localhost:8000/api/v1',
|
||||
baseHref: 'https://framadate-api.cipherbliss.com/api/v1',
|
||||
api_new_poll: '/poll/',
|
||||
api_get_poll: '/poll/{id}',
|
||||
api_new_vote_stack: '/poll/{id}/answer',
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"/api/*": {
|
||||
"target": "http://localhost:8000/api",
|
||||
"/api": {
|
||||
"target": "http://localhost:8000/api/v1/poll/aujourdhui-ou-demain/answer",
|
||||
"secure": false,
|
||||
"logLevel": "debug"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user