Skip to content

Commit

Permalink
Revalidate endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
pomber committed Dec 22, 2024
1 parent e13a3df commit 3733049
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions apps/web/app/api/revalidate/sponsors/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { revalidatePath } from "next/cache"

export async function POST(request: Request) {
try {
const text = await request.text()
console.log("[GitHub] Webhook received", text)

revalidatePath("/")
} catch (error: any) {
return new Response(`Webhook error: ${error.message}`, {
status: 400,
})
}

return new Response("Success!", {
status: 200,
})
}
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function HomePage() {
<Pricing />

<h3 className="text-center pb-8 text-primary/60 text-lg">Sponsors</h3>
<LatestSponsor className="mb-2" />
<LatestSponsor className="mb-4" />
<AllSponsors cta="Become a sponsor" className="mb-24" />

<PoweredBy className="mb-8 text-center flex items-center justify-center gap-4 w-full flex-wrap" />
Expand Down

0 comments on commit 3733049

Please sign in to comment.