Skip to content

Commit

Permalink
fix: put revalidation instructions for requests
Browse files Browse the repository at this point in the history
  • Loading branch information
jy95 committed Nov 4, 2023
1 parent a09f896 commit 0b70439
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/app/api/planning/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export type planningEntry = Omit<BasicGame, "genres" | "videoId" | "playlistId"
endDate?: number;
};

export async function GET(_request: Request) {
// Revalidate at most every day
// https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#revalidate
export const revalidate = 86400;

export async function GET() {

// current date as integer (quicker comparaison)
const currentDate = new Date();
Expand Down
6 changes: 5 additions & 1 deletion src/app/api/series/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ export type serieType = {
items: EnhancedGame[]
};

export async function GET(_request: Request) {
// Revalidate at most every day
// https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#revalidate
export const revalidate = 86400;

export async function GET() {

// Fetch games data
const gamesData = (await import("@/app/api/games/games.json")).default;
Expand Down
6 changes: 5 additions & 1 deletion src/app/api/stats/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ export type statsProperty = {
general: statsGeneral
};

export async function GET(_request: Request) {
// Revalidate at most every day
// https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#revalidate
export const revalidate = 86400;

export async function GET() {

const gamesData = (await import("../games/games.json")).default;

Expand Down

1 comment on commit 0b70439

@vercel
Copy link

@vercel vercel bot commented on 0b70439 Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

gpfr – ./

gpfr-jy95.vercel.app
jy95-github-io.vercel.app
gpfr-git-master-jy95.vercel.app

Please sign in to comment.