CognxSafeTrack commited on
Commit ·
b924b46
1
Parent(s): e2387c9
chore: add /debug/graph endpoint to explicitly test Facebook Graph API accessibility on HF
Browse files- apps/api/src/index.ts +9 -0
apps/api/src/index.ts
CHANGED
|
@@ -83,6 +83,15 @@ server.get('/debug/net', async (_req, reply) => {
|
|
| 83 |
}
|
| 84 |
});
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
server.get('/health', async () => {
|
| 87 |
return { status: 'ok', timestamp: new Date().toISOString() };
|
| 88 |
});
|
|
|
|
| 83 |
}
|
| 84 |
});
|
| 85 |
|
| 86 |
+
server.get('/debug/graph', async (_req, reply) => {
|
| 87 |
+
try {
|
| 88 |
+
const res = await fetch('https://graph.facebook.com', { method: 'GET' });
|
| 89 |
+
return reply.send({ ok: true, status: res.status });
|
| 90 |
+
} catch (e: any) {
|
| 91 |
+
return reply.code(500).send({ ok: false, error: e?.message || String(e) });
|
| 92 |
+
}
|
| 93 |
+
});
|
| 94 |
+
|
| 95 |
server.get('/health', async () => {
|
| 96 |
return { status: 'ok', timestamp: new Date().toISOString() };
|
| 97 |
});
|