diff --git a/2-copy-of-code/lesson-18/lesson18.html b/2-copy-of-code/lesson-18/lesson18.html index 7aaa340..94c1e3b 100644 --- a/2-copy-of-code/lesson-18/lesson18.html +++ b/2-copy-of-code/lesson-18/lesson18.html @@ -12,6 +12,7 @@ xhr.send(); */ + /* fetch( 'https://supersimplebackend.dev/greeting' ).then((response) => { @@ -19,6 +20,14 @@ }).then((text) => { console.log(text); }); + */ + + async function getGreeting() { + const response = await fetch('https://supersimplebackend.dev/greeting'); + const text = await response.text(); + console.log(text); + } + getGreeting(); \ No newline at end of file