Skip to content

Commit 9246fc5

Browse files
committed
comments
1 parent 68f44ab commit 9246fc5

File tree

5 files changed

+67
-6
lines changed

5 files changed

+67
-6
lines changed
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
// @ts-check
2-
import { defineConfig } from 'astro/config';
2+
import { defineConfig } from "astro/config";
33

4-
import tailwindcss from '@tailwindcss/vite';
4+
import tailwindcss from "@tailwindcss/vite";
5+
6+
import vercel from "@astrojs/vercel";
57

68
// https://astro.build/config
79
export default defineConfig({
810
vite: {
9-
plugins: [tailwindcss()]
10-
}
11-
});
11+
plugins: [tailwindcss()],
12+
},
13+
adapter: vercel({
14+
isr: {
15+
expiration: 60 * 60 * 24, // rebuild every page every day
16+
},
17+
}),
18+
});

apps/2-ssg/2-2-astro-ssg/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"astro": "astro"
1010
},
1111
"dependencies": {
12+
"@astrojs/vercel": "^8.0.8",
1213
"@tailwindcss/vite": "^4.0.7",
1314
"astro": "^5.3.0",
1415
"tailwindcss": "^4.0.7"

apps/3-ssr/3-4-astro-ssr/src/pages/posts/[id].astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ let comments: IComment[];
1818
let user: IUser;
1919
2020
try {
21+
//wait 3s
22+
// await new Promise((resolve) => setTimeout(resolve, 3000));
2123
const [postResponse, commentsResponse] = await Promise.all([
2224
fetch(`http://localhost:3300/posts/${postId}`),
2325
fetch(`http://localhost:3300/posts/${postId}/comments`),

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, 1000));
11+
// await new Promise((resolve) => setTimeout(resolve, 3000));
1212
const commentsResponse = await fetch(
1313
`http://localhost:3300/posts/${postId}/comments`,
1414
{

pnpm-lock.yaml

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)