Skip to content

Commit 793917d

Browse files
committed
feat: Add deployment check script for frontend and backend accessibility
1 parent add13f2 commit 793917d

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

check-deployment.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
const https = require('https');
2+
3+
console.log('\n🔍 CHECKING GITHUB PAGES DEPLOYMENT...\n');
4+
5+
const frontendUrl = 'https://nadeeshanj.github.io/Database-Project';
6+
const backendUrl = 'https://skynest-backend-api.onrender.com/api/health';
7+
8+
console.log('🌐 Testing Frontend URL:', frontendUrl);
9+
https.get(frontendUrl, (res) => {
10+
console.log(` Status: ${res.statusCode}`);
11+
if (res.statusCode === 200) {
12+
console.log(' ✅ Frontend is accessible');
13+
} else {
14+
console.log(' ❌ Frontend returned status:', res.statusCode);
15+
}
16+
}).on('error', (err) => {
17+
console.log(' ❌ Frontend error:', err.message);
18+
});
19+
20+
console.log('\n🔌 Testing Backend API:', backendUrl);
21+
https.get(backendUrl, (res) => {
22+
let data = '';
23+
res.on('data', chunk => data += chunk);
24+
res.on('end', () => {
25+
console.log(` Status: ${res.statusCode}`);
26+
if (res.statusCode === 200) {
27+
console.log(' ✅ Backend is accessible');
28+
try {
29+
const json = JSON.parse(data);
30+
console.log(' Response:', json);
31+
} catch(e) {
32+
console.log(' Response:', data.substring(0, 100));
33+
}
34+
} else {
35+
console.log(' ❌ Backend returned status:', res.statusCode);
36+
}
37+
});
38+
}).on('error', (err) => {
39+
console.log(' ❌ Backend error:', err.message);
40+
});
41+
42+
setTimeout(() => {
43+
console.log('\n' + '='.repeat(60));
44+
console.log('💡 If frontend loads but login fails:');
45+
console.log(' 1. Open browser console (F12) to see errors');
46+
console.log(' 2. Check Network tab for failed API calls');
47+
console.log(' 3. Verify backend is responding above');
48+
console.log('\n💡 If frontend doesn\'t load at all:');
49+
console.log(' 1. Check if gh-pages branch is deployed');
50+
console.log(' 2. Rebuild and redeploy: npm run deploy');
51+
console.log(' 3. Check GitHub Pages settings in repository');
52+
console.log('='.repeat(60) + '\n');
53+
}, 2000);

0 commit comments

Comments
 (0)