File size: 1,223 Bytes
ff792ca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>BF Conversations API</title>
<script>
// This page serves as a simple API endpoint
// It reads conversations.json and outputs it as JSON
async function loadAndServe() {
try {
const response = await fetch('../conversations.json');
const data = await response.json();
// Output JSON to page
document.body.textContent = JSON.stringify(data, null, 2);
document.body.style.whiteSpace = 'pre';
document.body.style.fontFamily = 'monospace';
// Also set CORS headers via meta tags (won't work but worth trying)
const meta = document.createElement('meta');
meta.httpEquiv = 'Access-Control-Allow-Origin';
meta.content = '*';
document.head.appendChild(meta);
} catch (error) {
document.body.textContent = JSON.stringify({error: error.message});
}
}
loadAndServe();
</script>
</head>
<body>
Loading...
</body>
</html> |