managarten/apps-archived/uload/scripts/test-url-variants.js
Till-JS 61d181fbc2 chore: archive inactive projects to apps-archived/
Move inactive projects out of active workspace:
- bauntown (community website)
- maerchenzauber (AI story generation)
- memoro (voice memo app)
- news (news aggregation)
- nutriphi (nutrition tracking)
- reader (reading app)
- uload (URL shortener)
- wisekeep (AI wisdom extraction)

Update CLAUDE.md documentation:
- Add presi to active projects
- Document archived projects section
- Update workspace configuration

Archived apps can be re-activated by moving back to apps/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 07:03:59 +01:00

76 lines
2 KiB
JavaScript

import PocketBase from 'pocketbase';
// Test verschiedene URL-Varianten
const urls = [
'http://pocketbase-xs0ccokk8s0goko4w40gwc0w.91.99.221.179.sslip.io', // ohne trailing slash
'http://pocketbase-xs0ccokk8s0goko4w40gwc0w.91.99.221.179.sslip.io/', // mit trailing slash
];
console.log('Testing different URL configurations...\n');
async function testUrl(url) {
console.log(`Testing: ${url}`);
console.log('-'.repeat(60));
try {
const pb = new PocketBase(url);
// Test 1: Health check
const healthUrl = `${url}/api/health`;
const healthResponse = await fetch(healthUrl);
console.log(`✓ Health check status: ${healthResponse.status}`);
// Test 2: Registration
const testEmail = `test${Date.now()}@example.com`;
const testUsername = `user${Date.now()}`;
const userData = {
email: testEmail,
password: 'TestPass123!',
passwordConfirm: 'TestPass123!',
username: testUsername,
name: 'Test User',
emailVisibility: true,
};
console.log(` Attempting registration with: ${testEmail}`);
try {
const result = await pb.collection('users').create(userData);
console.log(`✓ Registration successful! User ID: ${result.id}`);
// Clean up
try {
await pb.collection('users').delete(result.id);
console.log('✓ Test user cleaned up');
} catch (e) {
console.log('⚠ Could not clean up test user');
}
} catch (err) {
console.error(`✗ Registration failed: ${err.message}`);
if (err.response?.data) {
console.error(' Error details:', JSON.stringify(err.response.data, null, 2));
}
}
console.log('✓ URL configuration works!\n');
return true;
} catch (error) {
console.error(`✗ URL configuration failed: ${error.message}\n`);
return false;
}
}
// Test all URLs
async function testAll() {
for (const url of urls) {
const success = await testUrl(url);
if (success) {
console.log(`\n🎉 WORKING URL: ${url}`);
console.log('Use this exact URL in your environment variables (without quotes)');
break;
}
}
}
testAll();