Skip to content

Commit

Permalink
Merge pull request #57 from jasondev01/api-route-revalidation
Browse files Browse the repository at this point in the history
Added revalidation zero for zero cache on the api routes
  • Loading branch information
Dovakiin0 authored Apr 8, 2024
2 parents ff9a3da + f1d45ce commit 77133a6
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/api/anime/gogo/watch/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export async function GET(
const episode = await gogo.fetchEpisodeSources(params.id);
return NextResponse.json(episode);
}

export const revalidate = 0
2 changes: 2 additions & 0 deletions src/app/api/anime/info/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ export async function GET(
let infoData = { ...info, id };
return NextResponse.json(infoData);
}

export const revalidate = 0
2 changes: 2 additions & 0 deletions src/app/api/anime/popular/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export async function GET(
const popular = await gogo.fetchTopAiring();
return NextResponse.json(popular.results);
}

export const revalidate = 0
2 changes: 2 additions & 0 deletions src/app/api/anime/recent/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export async function GET(
const recent = await gogo.fetchRecentEpisodes();
return NextResponse.json(recent.results);
}

export const revalidate = 0
2 changes: 2 additions & 0 deletions src/app/api/anime/search/[query]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export async function GET(
const search = await gogo.search(params.query);
return NextResponse.json(search.results);
}

export const revalidate = 0
2 changes: 2 additions & 0 deletions src/app/api/anime/zoro/watch/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ export async function GET(
const episode = await zoro.fetchEpisodeSources(id);
return NextResponse.json(episode);
}

export const revalidate = 0
2 changes: 2 additions & 0 deletions src/app/api/news/ann/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ export async function GET(req: Request) {
const news = await ann.fetchNewsFeeds(Topics.ANIME);
return NextResponse.json(news, { status: 200 });
}

export const revalidate = 0
2 changes: 2 additions & 0 deletions src/app/api/tmdb/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ async function getTMDBLogo(id: number) {
const infoData = await res.json();
return infoData;
}

export const revalidate = 0

0 comments on commit 77133a6

Please sign in to comment.