Files
formbricks/apps/web/app/api/cron/ping/route.ts
T
Shubham Palriwala 652e0bc9c9 feat: endpoint + telemetry for live self hosted instances (#1675)
Signed-off-by: Neil Chauhan <neilchauhan2@gmail.com>
Co-authored-by: Neil Chauhan <neilchauhan2@gmail.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
2023-11-27 10:28:33 +00:00

18 lines
498 B
TypeScript

import { responses } from "@/app/lib/api/response";
import { CRON_SECRET } from "@formbricks/lib/constants";
import { captureTelemetry } from "@formbricks/lib/telemetry";
import { headers } from "next/headers";
export async function POST() {
const headersList = headers();
const apiKey = headersList.get("x-api-key");
if (!apiKey || apiKey !== CRON_SECRET) {
return responses.notAuthenticatedResponse();
}
captureTelemetry("ping");
return responses.successResponse({}, true);
}