This commit is contained in:
bipproduction
2025-10-20 15:59:35 +08:00
parent ea1937da6d
commit 66d3df0a12
2 changed files with 27 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ import type { User } from "generated/prisma";
import WaRoute from "./server/routes/wa_route";
import WebhookRoute from "./server/routes/webhook_route";
import cors from "@elysiajs/cors";
import WaHookRoute from "./server/routes/wa_hook_route";
const Docs = new Elysia().use(
Swagger({
@@ -33,7 +34,8 @@ const Api = new Elysia({
.use(Dashboard)
.use(ApiUser)
.use(WaRoute)
.use(WebhookRoute);
.use(WebhookRoute)
.use(WaHookRoute);
const app = new Elysia()
.use(cors())

View File

@@ -0,0 +1,24 @@
import Elysia, { t } from "elysia";
const WaHookRoute = new Elysia({
prefix: "/wa-hook",
tags: ["WhatsApp Hook"],
})
.post("/hook", async (ctx) => {
const { body } = ctx.body;
console.log(body);
return {
success: true,
message: "WhatsApp Hook received"
};
}, {
body: t.Any(),
detail: {
summary: "WhatsApp Hook",
description: "WhatsApp Hook",
},
})
export default WaHookRoute;