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:
Ing. Jiří Mlejnek 2023-11-06 18:47:02 +01:00
commit dff04667db
4 changed files with 24 additions and 23 deletions

View file

@ -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>

View file

@ -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);

0
mvnw vendored Normal file → Executable file
View file