Openstatus www.openstatus.dev
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

๐Ÿ“ ping warn/cold (#667)

authored by

Thibault Le Ouay and committed by
GitHub
d577c6aa ef50ce05

+29
+14
apps/web/src/app/api/ping/cold/route.ts
··· 1 + import { NextResponse } from "next/server"; 2 + 3 + export const dynamic = "force-dynamic"; 4 + 5 + export const maxDuration = 30; // to trick and not using the same function as the other ping route 6 + 7 + export async function GET() { 8 + return NextResponse.json({ ping: "pong" }, { status: 200 }); 9 + } 10 + 11 + export async function POST(req: Request) { 12 + const body = await req.json(); 13 + return NextResponse.json({ ping: body }, { status: 200 }); 14 + }
+2
apps/web/src/app/api/ping/route.ts
··· 2 2 3 3 export const dynamic = "force-dynamic"; 4 4 5 + export const maxDuration = 25; // to trick and not using the same function as the other ping route 6 + 5 7 export async function GET() { 6 8 return NextResponse.json({ ping: "pong" }, { status: 200 }); 7 9 }
+13
apps/web/src/app/api/ping/warn/route.ts
··· 1 + import { NextResponse } from "next/server"; 2 + 3 + export const dynamic = "force-dynamic"; 4 + export const maxDuration = 20; // to trick and not using the same function as the other ping route 5 + 6 + export async function GET() { 7 + return NextResponse.json({ ping: "pong" }, { status: 200 }); 8 + } 9 + 10 + export async function POST(req: Request) { 11 + const body = await req.json(); 12 + return NextResponse.json({ ping: body }, { status: 200 }); 13 + }