Merge branch 'mm-frontend-api-root' into 'master'
Use relative base url for backend See merge request BI-IDO/bi-ido-flight-log-public!7
This commit is contained in:
commit
dff04667db
File diff suppressed because one or more lines are too long
|
@ -9,5 +9,5 @@
|
|||
</head>
|
||||
<body aurelia-app="main">
|
||||
|
||||
<script type="text/javascript" src="/app.768a36b72f06ac99edf3.bundle.js"></script><script type="text/javascript" src="/vendor.ba835e659bca766e203c.bundle.js"></script></body>
|
||||
<script type="text/javascript" src="/app.bundle.js"></script><script type="text/javascript" src="/vendor.ba835e659bca766e203c.bundle.js"></script></body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import environment from './environment';
|
||||
import {PLATFORM} from 'aurelia-pal';
|
||||
import { PLATFORM } from 'aurelia-pal';
|
||||
import * as Bluebird from 'bluebird';
|
||||
import {HttpClient} from 'aurelia-fetch-client';
|
||||
import { HttpClient } from 'aurelia-fetch-client';
|
||||
|
||||
|
||||
// remove out if you don't want a Promise polyfill (remove also from webpack.config.js)
|
||||
|
@ -17,24 +17,24 @@ export function configure(aurelia) {
|
|||
let http = new HttpClient();
|
||||
http.configure(config => {
|
||||
config
|
||||
.useStandardConfiguration()
|
||||
.withBaseUrl('http://localhost:8081/')
|
||||
.withDefaults({
|
||||
headers: {
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
})
|
||||
.withInterceptor({
|
||||
request(request) {
|
||||
console.log(`Requesting ${request.method} ${request.url}`);
|
||||
return request;
|
||||
},
|
||||
response(response) {
|
||||
console.log(`Received ${response.status} ${response.url}`);
|
||||
return response;
|
||||
}
|
||||
});
|
||||
});
|
||||
.useStandardConfiguration()
|
||||
.withBaseUrl('/') // It used to be http://localhost:8081, but let it use default host
|
||||
.withDefaults({
|
||||
headers: {
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
})
|
||||
.withInterceptor({
|
||||
request(request) {
|
||||
console.log(`Requesting ${request.method} ${request.url}`);
|
||||
return request;
|
||||
},
|
||||
response(response) {
|
||||
console.log(`Received ${response.status} ${response.url}`);
|
||||
return response;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
container.registerInstance(HttpClient, http);
|
||||
|
||||
|
|
Loading…
Reference in a new issue