Skip to content

Commit 6e3cd17

Browse files
authored
Update committee.js
making it fetch api every 10 second
1 parent 0d1c8eb commit 6e3cd17

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

src/pages/committee.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,23 @@ function toGoogleImageUrl(thumbnailUrl) {
150150
}
151151

152152

153+
// export async function getStaticProps() {
154+
// const res = await fetch(`https://wrcrobotics.pythonanywhere.com/committee`);
155+
// const committeeData = await res.json();
156+
157+
// return {
158+
// props: {
159+
// committeeData,
160+
// },
161+
// };
162+
// }
153163
export async function getStaticProps() {
154-
const res = await fetch(`https://wrcrobotics.pythonanywhere.com/committee`);
164+
const res = await fetch("https://wrcrobotics.pythonanywhere.com/committee");
155165
const committeeData = await res.json();
156166

157167
return {
158-
props: {
159-
committeeData,
160-
},
168+
props: { committeeData },
169+
revalidate: 10, // updates every 10 seconds
161170
};
162171
}
163172

0 commit comments

Comments
 (0)