whatsapp-api-js
Version:
A TypeScript server agnostic Whatsapp's Official API framework
3 lines (2 loc) • 433 B
JavaScript
import{WhatsAppAPIMiddleware}from"./globals.js";import{isInteger}from"../utils.js";class WhatsAppAPI extends WhatsAppAPIMiddleware{async handle_post(req){try{return this.post(JSON.parse(req.body??"{}"),req.body,req.header("x-hub-signature-256"))}catch(e){return isInteger(e)?e:500}}handle_get(req){try{return this.get(req.query)}catch(e){throw isInteger(e)?e:500}}}export{WhatsAppAPI as default};
//# sourceMappingURL=express.js.map