CognxSafeTrack commited on
Commit
e1c8d70
Β·
1 Parent(s): e4d508b

fix: revert to tsx and add diagnostic routes

Browse files
apps/api/src/index.ts CHANGED
@@ -197,8 +197,17 @@ server.register(async function guardedRoutes(scope) {
197
  });
198
 
199
  // ── Health Routes (public) ─────────────────────────────────────────────────────
200
- server.get('/', async (_req) => {
201
- return { ok: true };
 
 
 
 
 
 
 
 
 
202
  });
203
 
204
  server.get('/debug/net', async (_req, reply) => {
 
197
  });
198
 
199
  // ── Health Routes (public) ─────────────────────────────────────────────────────
200
+ server.get('/', async () => {
201
+ return {
202
+ status: 'ok',
203
+ message: 'EdTech API Gateway is running',
204
+ version: '1.1.0',
205
+ timestamp: new Date().toISOString()
206
+ };
207
+ });
208
+
209
+ server.get('/health', async () => {
210
+ return { status: 'ok', uptime: process.uptime() };
211
  });
212
 
213
  server.get('/debug/net', async (_req, reply) => {
apps/whatsapp-worker/Dockerfile CHANGED
@@ -31,5 +31,5 @@ EXPOSE 3001
31
  # ─── Combined startup ─────────────────────────────────────────────────────────
32
  # db:push is best-effort β€” failure must NOT block the API or worker.
33
  # API (webhook + REST) and worker (BullMQ) start in parallel.
34
- CMD ["sh", "-c", "(pnpm --filter @repo/database db:push || echo '[CMD] db:push skipped or failed β€” continuing') && node /app/apps/api/dist/index.js & sleep 2 && node /app/apps/whatsapp-worker/dist/index.js & wait"]
35
 
 
31
  # ─── Combined startup ─────────────────────────────────────────────────────────
32
  # db:push is best-effort β€” failure must NOT block the API or worker.
33
  # API (webhook + REST) and worker (BullMQ) start in parallel.
34
+ CMD ["sh", "-c", "(pnpm --filter @repo/database db:push || echo '[CMD] db:push skipped or failed β€” continuing') && npx tsx /app/apps/api/src/index.ts & sleep 2 && npx tsx /app/apps/whatsapp-worker/src/index.ts & wait"]
35