26 lines
808 B
JavaScript
26 lines
808 B
JavaScript
// Quick setup script for testing
|
|
const { createUser } = require('./src/auth/auth');
|
|
|
|
async function setup() {
|
|
try {
|
|
console.log('Creating test user...');
|
|
await createUser('admin', 'password123');
|
|
console.log('✓ User "admin" created successfully!');
|
|
console.log('✓ You can now start the server with: npm start');
|
|
console.log('✓ Login credentials: admin / password123');
|
|
process.exit(0);
|
|
} catch (error) {
|
|
if (error.message.includes('already exists')) {
|
|
console.log('✓ User "admin" already exists');
|
|
console.log('✓ You can now start the server with: npm start');
|
|
console.log('✓ Login credentials: admin / password123');
|
|
process.exit(0);
|
|
} else {
|
|
console.error('Error:', error.message);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
}
|
|
|
|
setup();
|