I’ve create a simple example, I want the ssr to render a page just after the result return from an API :
It base on this code https://github.com/aurelia/skeleton-navigation
I put this code on activate:
async activate(): Promise<void> {
return new Promise((res, rej) => {
fetch('http://api.openweathermap.org/data/2.5/weather?id=524901&appid=b9f63d9b76f67b6ff44a81a37044b254')
.then(data => data.json())
.then((json) => {
this.renderResult(json);
res();
})
.catch((error) => rej(error));
})
}
how can I make ssr wait to response from api and base on the response rerender the page ?