Skip to content

Open-source status page, incident response and uptime monitoring

🏓 ping warn/cold (#667)

Thibault Le Ouayd577c6aaa18a
diff --git a/apps/web/src/app/api/ping/cold/route.ts b/apps/web/src/app/api/ping/cold/route.ts
new file mode 100644
index 000000000..f03c578b3
--- /dev/null
+++ b/apps/web/src/app/api/ping/cold/route.ts
@@ -0,0 +1,14 @@
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export const maxDuration = 30; // to trick and not using the same function as the other ping route
+
+export async function GET() {
+ return NextResponse.json({ ping: "pong" }, { status: 200 });
+}
+
+export async function POST(req: Request) {
+ const body = await req.json();
+ return NextResponse.json({ ping: body }, { status: 200 });
+}
diff --git a/apps/web/src/app/api/ping/route.ts b/apps/web/src/app/api/ping/route.ts
index 0bd5d4d60..0bf10dd25 100644
--- a/apps/web/src/app/api/ping/route.ts
+++ b/apps/web/src/app/api/ping/route.ts
@@ -2,6 +2,8 @@ import { NextResponse } from "next/server";
export const dynamic = "force-dynamic";
+export const maxDuration = 25; // to trick and not using the same function as the other ping route
+
export async function GET() {
return NextResponse.json({ ping: "pong" }, { status: 200 });
}
diff --git a/apps/web/src/app/api/ping/warn/route.ts b/apps/web/src/app/api/ping/warn/route.ts
new file mode 100644
index 000000000..173a18b52
--- /dev/null
+++ b/apps/web/src/app/api/ping/warn/route.ts
@@ -0,0 +1,13 @@
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+export const maxDuration = 20; // to trick and not using the same function as the other ping route
+
+export async function GET() {
+ return NextResponse.json({ ping: "pong" }, { status: 200 });
+}
+
+export async function POST(req: Request) {
+ const body = await req.json();
+ return NextResponse.json({ ping: body }, { status: 200 });
+}