Files
frontend-bootcamp/step2-01/src/async/index.ts
2019-02-15 20:13:29 -08:00

9 lines
200 B
TypeScript

async function fetchSomething() {
const response = await fetch('http://localhost:3000/hello');
return await response.text();
}
fetchSomething().then(text => {
console.log('hello ' + text);
});