From 6396cf67703efa8ac09ea2cc6f55f39b55e562a1 Mon Sep 17 00:00:00 2001 From: Kevin Cantrell Date: Sun, 24 Aug 2025 18:02:21 +0900 Subject: [PATCH] testing endpoint --- src/routes/api/auth/line/webhook-callback/+server.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/routes/api/auth/line/webhook-callback/+server.ts b/src/routes/api/auth/line/webhook-callback/+server.ts index 7f51e5b7..04d69421 100644 --- a/src/routes/api/auth/line/webhook-callback/+server.ts +++ b/src/routes/api/auth/line/webhook-callback/+server.ts @@ -40,6 +40,17 @@ export const POST: RequestHandler = async (event) => { }); }; +// Provide a simple GET response so visiting the URL in a browser doesn't 404 (was causing confusion) +export const GET: RequestHandler = async () => { + return new Response( + JSON.stringify({ + ok: true, + message: 'LINE webhook endpoint is alive. Send POST requests with JSON body.' + }), + { status: 200, headers: { 'content-type': 'application/json' } } + ); +}; + // (Optional future helper) Example signature verification placeholder // function verifyLineSignature(signature: string | null, secret: string, body: string | ArrayBuffer) { // if (!signature) return false;