Simplify the setup proccess of WhatsAppAPI for different frameworks.
import { WhatsAppAPI } from "whatsapp-api-js/middleware/deno";const Whatsapp = new WhatsAppAPI({ token: "YOUR_TOKEN", appSecret: "YOUR_APP_SECRET"});Deno.serve(async (req) => { if (req.method === "POST") { const status = await Whatsapp.handle_post(req); return new Response(null, { status }); } else if (req.method === "GET") { const challenge = Whatsapp.handle_get(req); return new Response(challenge); }}); Copy
import { WhatsAppAPI } from "whatsapp-api-js/middleware/deno";const Whatsapp = new WhatsAppAPI({ token: "YOUR_TOKEN", appSecret: "YOUR_APP_SECRET"});Deno.serve(async (req) => { if (req.method === "POST") { const status = await Whatsapp.handle_post(req); return new Response(null, { status }); } else if (req.method === "GET") { const challenge = Whatsapp.handle_get(req); return new Response(challenge); }});
Description
Simplify the setup proccess of WhatsAppAPI for different frameworks.
Example
See