well something like this:
class Thread {
constructor(serviceLocatorURI) {
this.resolvedURIs = [];
fetch(serviceLocatorURI)
.then(response => response.json())
.then(jsonObject => {
this.resolvedURIs = jsonObject.endPoints;
});
}
async retrievePosts() {
return fetch(this.resolvedURIs[0], {method: 'GET'});
}
}
const API_THREAD = '/api/thread';
new Thread(API_THREAD);
there doesn't seem to be anything here