From bc81291afc9100bc37d8e3e19ca0055c422dce41 Mon Sep 17 00:00:00 2001 From: tanhauhau Date: Wed, 20 Apr 2022 12:27:48 +0800 Subject: [PATCH 1/2] use own api to replace jsonplaceholder.typicode.com --- site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte b/site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte index 831914fa6a..7dc7a1ec7a 100644 --- a/site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte +++ b/site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte @@ -4,7 +4,7 @@ let photos = []; onMount(async () => { - const res = await fetch(`https://jsonplaceholder.typicode.com/photos?_limit=20`); + const res = await fetch(`/tutorial/api/album`); photos = await res.json(); }); From 3e5846c7c50e4ebcae29994b694590846db26b2d Mon Sep 17 00:00:00 2001 From: tanhauhau Date: Wed, 20 Apr 2022 12:52:22 +0800 Subject: [PATCH 2/2] update api --- site/content/examples/06-lifecycle/00-onmount/App.svelte | 2 +- site/content/tutorial/07-lifecycle/01-onmount/text.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/examples/06-lifecycle/00-onmount/App.svelte b/site/content/examples/06-lifecycle/00-onmount/App.svelte index b6c3100e58..06997161f0 100644 --- a/site/content/examples/06-lifecycle/00-onmount/App.svelte +++ b/site/content/examples/06-lifecycle/00-onmount/App.svelte @@ -4,7 +4,7 @@ let photos = []; onMount(async () => { - const res = await fetch(`https://jsonplaceholder.typicode.com/photos?_limit=20`); + const res = await fetch(`/tutorial/api/album`); photos = await res.json(); }); diff --git a/site/content/tutorial/07-lifecycle/01-onmount/text.md b/site/content/tutorial/07-lifecycle/01-onmount/text.md index f24fce5fc2..6baa254e9f 100644 --- a/site/content/tutorial/07-lifecycle/01-onmount/text.md +++ b/site/content/tutorial/07-lifecycle/01-onmount/text.md @@ -15,7 +15,7 @@ We'll add an `onMount` handler that loads some data over the network: let photos = []; onMount(async () => { - const res = await fetch(`https://jsonplaceholder.typicode.com/photos?_limit=20`); + const res = await fetch(`/tutorial/api/album`); photos = await res.json(); });