RTSDA-Website/astro-church-website/src/lib/bindings.js
Benjamin Slingo 7d6946c2d1 Fix native bindings path - correct relative path from dist
- Change to ../../../index.js to account for dist/server/chunks/ depth
- Resolves module not found error in production build
2025-08-28 16:01:50 -04:00

33 lines
777 B
JavaScript

// First, rename the CommonJS file to .cjs
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
// Require the CommonJS module
const nativeBindings = require('../../../index.js');
export const {
getChurchName,
fetchEventsJson,
fetchFeaturedEventsJson,
fetchSermonsJson,
fetchLivestreamArchiveJson,
fetchConfigJson,
getMissionStatement,
fetchRandomBibleVerseJson,
getStreamLiveStatus,
getLivestreamUrl,
getChurchAddress,
getChurchPhysicalAddress,
getChurchPoBox,
getContactPhone,
getContactEmail,
getFacebookUrl,
getYoutubeUrl,
getInstagramUrl,
submitContactV2Json,
validateContactFormJson,
fetchBulletinsJson,
fetchCurrentBulletinJson,
fetchBibleVerseJson,
submitEventJson
} = nativeBindings;