Test server for CORS communication.
You should create an hostname for the server in your hosts
.
notepad.exe "C:\Windows\System32\drivers\etc\hosts"
127.0.0.1 cors-test-server.local
Run genkey
and set the common name to the host name
Common Name (e.g. server FQDN or YOUR name) []: cors-test-server.local
node main.js
curl -k https://cors-test-server.local:3000
import {HttpClient} from 'aurelia-fetch-client';
import {autoinject} from 'aurelia-framework';
@autoinject()
class CorsClient {
constructor(httpClient: HttpClient) {
httpClient.configure(config => {
config
.useStandardConfiguration()
.rejectErrorResponses()
.withDefaults({
credentials: "include",
mode: "cors"
});
});
}
}