managarten/uload/scripts/test-pb-connection.js
Till-JS c712a2504a feat: integrate uload and picture, unify package naming
- Add uload project with apps/web structure
  - Reorganize from flat to monorepo structure
  - Remove PocketBase binary and local data
  - Update to pnpm and @uload/web namespace

- Add picture project to monorepo
  - Remove embedded git repository

- Unify all package names to @{project}/{app} schema:
  - @maerchenzauber/* (was @storyteller/*)
  - @manacore/* (was manacore-*, manacore)
  - @manadeck/* (was web, backend, manadeck)
  - @memoro/* (was memoro-web, landing, memoro)
  - @picture/* (already unified)
  - @uload/web

- Add convenient dev scripts for all apps:
  - pnpm dev:{project}:web
  - pnpm dev:{project}:landing
  - pnpm dev:{project}:mobile
  - pnpm dev:{project}:backend

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 04:00:36 +01:00

35 lines
1 KiB
JavaScript

import PocketBase from 'pocketbase';
const pb = new PocketBase('http://localhost:8090');
console.log('Testing PocketBase connection...');
try {
// Test health endpoint
const health = await fetch('http://localhost:8090/api/health');
const healthData = await health.json();
console.log('Health check:', healthData);
// Try to create a test user
const testUser = await pb.collection('users').create({
email: `test${Date.now()}@example.com`,
password: 'testpassword123',
passwordConfirm: 'testpassword123',
username: `testuser${Date.now()}`,
name: 'Test User',
emailVisibility: true
});
console.log('✅ User created successfully:', testUser.id);
console.log('Username:', testUser.username);
console.log('Email:', testUser.email);
// Clean up - delete test user
await pb.collection('users').delete(testUser.id);
console.log('✅ Test user deleted');
} catch (error) {
console.error('❌ Error:', error.message);
if (error.data) {
console.error('Error details:', JSON.stringify(error.data, null, 2));
}
}