Skip to content

Commit ba0869f

Browse files
Copilotasperpharma
andcommitted
Fix scripts to use ES modules
Co-authored-by: asperpharma <252395498+asperpharma@users.noreply.github.com>
1 parent 1d791de commit ba0869f

2 files changed

Lines changed: 14 additions & 18 deletions

File tree

scripts/health-check.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* npm run health
99
*/
1010

11-
const https = require('https');
12-
const http = require('http');
11+
import https from 'https';
12+
import http from 'http';
1313

1414
const SITE_URL = process.env.SITE_URL || 'https://asperbeautyshop-com.lovable.app';
1515
const TIMEOUT_MS = 10000;
@@ -164,11 +164,9 @@ async function main() {
164164
}
165165

166166
// Run if called directly
167-
if (require.main === module) {
168-
main().catch(error => {
169-
console.error('Fatal error:', error);
170-
process.exit(1);
171-
});
172-
}
167+
main().catch(error => {
168+
console.error('Fatal error:', error);
169+
process.exit(1);
170+
});
173171

174-
module.exports = { checkEndpoint, checkHealthEndpoint };
172+
export { checkEndpoint, checkHealthEndpoint };

scripts/test-brain.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* npm run test:brain
99
*/
1010

11-
const https = require('https');
12-
const http = require('http');
11+
import https from 'https';
12+
import http from 'http';
1313

1414
const SITE_URL = process.env.SITE_URL || 'https://asperbeautyshop-com.lovable.app';
1515
const SUPABASE_URL = process.env.VITE_SUPABASE_URL || 'https://qqceibvalkoytafynwoc.supabase.co';
@@ -191,11 +191,9 @@ async function main() {
191191
}
192192

193193
// Run if called directly
194-
if (require.main === module) {
195-
main().catch(error => {
196-
console.error('Fatal error:', error);
197-
process.exit(1);
198-
});
199-
}
194+
main().catch(error => {
195+
console.error('Fatal error:', error);
196+
process.exit(1);
197+
});
200198

201-
module.exports = { testSupabaseConnection, testBeautyAssistantEndpoint, testConciergePresence };
199+
export { testSupabaseConnection, testBeautyAssistantEndpoint, testConciergePresence };

0 commit comments

Comments
 (0)