Skip to content

Commit 8c97291

Browse files
committed
enable delay
1 parent 9246fc5 commit 8c97291

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

apps/0-json-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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"

apps/4-streaming/4-4-astro-server-islands/src/components/Comments.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Props {
88
const { 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));
1212
const commentsResponse = await fetch(
1313
`http://localhost:3300/posts/${postId}/comments`,
1414
{

apps/4-streaming/4-4-astro-server-islands/src/pages/posts/[id].astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Comments from "../../components/Comments.astro";
44
import { type IPost, type IUser } from "../../api-types";
55
66
export 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

0 commit comments

Comments
 (0)