File tree Expand file tree Collapse file tree 3 files changed +3
-2
lines changed
4-streaming/4-4-astro-server-islands/src Expand file tree Collapse file tree 3 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 55 "type" : " module" ,
66 "scripts" : {
77 "dev0" : " pnpm serve" ,
8- "serve" : " json-server --watch db.json --delay 0 --port 3300"
8+ "serve" : " json-server --watch db.json --delay 400 --port 3300"
99 },
1010 "dependencies" : {
1111 "json-server" : " 0.17.4"
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ interface Props {
88const { postId } = Astro .props ;
99
1010// Fetch comments for this post with artificial delay
11- // await new Promise((resolve) => setTimeout(resolve, 3000));
11+ await new Promise ((resolve ) => setTimeout (resolve , 3000 ));
1212const commentsResponse = await fetch (
1313 ` http://localhost:3300/posts/${postId }/comments ` ,
1414 {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import Comments from "../../components/Comments.astro";
44import { type IPost , type IUser } from " ../../api-types" ;
55
66export async function getStaticPaths() {
7+ await new Promise ((resolve ) => setTimeout (resolve , 3000 ));
78 const response = await fetch (` http://localhost:3300/posts ` );
89 const posts = (await response .json ()) as IPost [];
910
You can’t perform that action at this time.
0 commit comments