mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
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 {
|
export class ApiService {
|
||||||
private static loader: LoaderService;
|
private static loader: LoaderService;
|
||||||
private http: HttpClient;
|
|
||||||
private useDevLocalServer = true;
|
private useDevLocalServer = true;
|
||||||
private devLocalServerBaseHref = 'http://localhost:8000/';
|
private devLocalServerBaseHref = 'http://localhost:8000/';
|
||||||
private axiosInstance: AxiosInstance;
|
private axiosInstance: AxiosInstance;
|
||||||
@ -117,9 +116,9 @@ export class ApiService {
|
|||||||
|
|
||||||
console.log('vote_stack', vote_stack);
|
console.log('vote_stack', vote_stack);
|
||||||
console.log('this.baseHref', this.baseHref);
|
console.log('this.baseHref', this.baseHref);
|
||||||
let headers = ApiService.makeHeaders();
|
let headers = ApiService.makeHeaders(vote_stack);
|
||||||
console.log('headers', headers);
|
console.log('headers', headers);
|
||||||
let url = `${this.baseHref}/${poll.custom_url}/answer`;
|
let url = `${this.baseHref}/poll/${poll.custom_url}/answer`;
|
||||||
|
|
||||||
let axiosconf = {
|
let axiosconf = {
|
||||||
url,
|
url,
|
||||||
@ -128,7 +127,14 @@ export class ApiService {
|
|||||||
headers,
|
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">
|
<section class="poll_loaded padded" *ngIf="!fetching && poll">
|
||||||
<div class="well debug">
|
<div class="well debug">
|
||||||
<!-- infos locales storage-->
|
<!-- infos locales storage-->
|
||||||
debug: {{ storageService.vote_stack | json }}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- messages-->
|
<!-- messages-->
|
||||||
|
@ -4,10 +4,12 @@
|
|||||||
|
|
||||||
const backendApiUrlsInDev = {
|
const backendApiUrlsInDev = {
|
||||||
local: '/api/v1',
|
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 = {
|
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_new_poll: '/poll/',
|
||||||
api_get_poll: '/poll/{id}',
|
api_get_poll: '/poll/{id}',
|
||||||
api_new_vote_stack: '/poll/{id}/answer',
|
api_new_vote_stack: '/poll/{id}/answer',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"/api/*": {
|
"/api": {
|
||||||
"target": "http://localhost:8000/api",
|
"target": "http://localhost:8000/api/v1/poll/aujourdhui-ou-demain/answer",
|
||||||
"secure": false,
|
"secure": false,
|
||||||
"logLevel": "debug"
|
"logLevel": "debug"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user