CognxSafeTrack commited on
Commit Β·
34ee9c2
1
Parent(s): 632fb8d
deploy: stabilization and final typings for WhatsApp worker bridge
Browse files
apps/whatsapp-worker/src/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { logger } from './logger';
|
|
| 2 |
import dns from 'node:dns';
|
| 3 |
dns.setDefaultResultOrder('ipv4first');
|
| 4 |
|
| 5 |
-
import fastify from 'fastify';
|
| 6 |
import { Queue, Worker, Job } from 'bullmq';
|
| 7 |
import dotenv from 'dotenv';
|
| 8 |
import Redis from 'ioredis';
|
|
@@ -56,7 +56,8 @@ const handlers: Record<string, JobHandler> = {
|
|
| 56 |
};
|
| 57 |
|
| 58 |
// βββ HTTP SERVER (Inbound Bridge) βββββββββββββββββββββββββββββββββββββββββββββ
|
| 59 |
-
// This server receives forwarded webhooks from the Hugging Face Gateway
|
|
|
|
| 60 |
const server = fastify({ logger: false });
|
| 61 |
|
| 62 |
server.post('/v1/internal/whatsapp/inbound', async (req: FastifyRequest, reply: FastifyReply) => {
|
|
|
|
| 2 |
import dns from 'node:dns';
|
| 3 |
dns.setDefaultResultOrder('ipv4first');
|
| 4 |
|
| 5 |
+
import fastify, { FastifyRequest, FastifyReply } from 'fastify';
|
| 6 |
import { Queue, Worker, Job } from 'bullmq';
|
| 7 |
import dotenv from 'dotenv';
|
| 8 |
import Redis from 'ioredis';
|
|
|
|
| 56 |
};
|
| 57 |
|
| 58 |
// βββ HTTP SERVER (Inbound Bridge) βββββββββββββββββββββββββββββββββββββββββββββ
|
| 59 |
+
// This server receives forwarded webhooks from the Hugging Face Gateway.
|
| 60 |
+
// It acts as a bridge between the public API and the private BullMQ worker.
|
| 61 |
const server = fastify({ logger: false });
|
| 62 |
|
| 63 |
server.post('/v1/internal/whatsapp/inbound', async (req: FastifyRequest, reply: FastifyReply) => {
|