DB connection restored.

This commit is contained in:
AG
2025-12-07 20:56:35 +02:00
parent 34900aebdd
commit e893336d46
4 changed files with 38 additions and 1 deletions

Binary file not shown.

View File

@@ -39,6 +39,8 @@ if (!dbUrl) {
}
console.log('Initializing Prisma Adapter with URL:', dbUrl);
// Use the options object as required by the library definitions
const adapter = new PrismaBetterSqlite3({ url: dbUrl });
const prisma =

View File

@@ -0,0 +1,35 @@
async function main() {
const email = `test_${Date.now()}@example.com`;
const password = 'password123';
console.log(`Registering ${email}...`);
try {
const regRes = await fetch('http://localhost:3001/api/auth/register', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, password })
});
const regData = await regRes.json();
console.log('Register:', regRes.status, regData);
if (!regData.success) {
console.error('Registration failed');
return;
}
console.log('Logging in...');
const loginRes = await fetch('http://localhost:3001/api/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, password })
});
const loginData = await loginRes.json();
console.log('Login:', loginRes.status, loginData.success ? 'Success' : 'Fail');
} catch (e) {
console.error('Fetch failed:', e);
}
}
main();

View File

@@ -10,7 +10,7 @@ export default defineConfig(({ mode }) => {
host: '0.0.0.0',
proxy: {
'/api': {
target: 'http://127.0.0.1:3002',
target: 'http://127.0.0.1:3001',
changeOrigin: true,
secure: false,
}