- Complete web-based STL file storage and 3D viewer - Express.js backend with SQLite database - Interactive Three.js 3D viewer with orbit controls - File upload with drag-and-drop support - Security features: rate limiting, input validation, helmet - Container deployment with Docker/Podman - Production-ready configuration management - Comprehensive logging and monitoring 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
26 lines
716 B
JavaScript
26 lines
716 B
JavaScript
const STLDatabase = require('./database');
|
|
|
|
async function initializeDatabase() {
|
|
console.log('Initializing STL database...');
|
|
|
|
const db = new STLDatabase('./stl_storage.db', './uploads');
|
|
|
|
try {
|
|
await db.initialize();
|
|
console.log('✅ Database initialized successfully');
|
|
console.log('✅ Upload directory created');
|
|
console.log('✅ Database schema created');
|
|
|
|
await db.close();
|
|
console.log('Database setup complete!');
|
|
} catch (error) {
|
|
console.error('❌ Error initializing database:', error);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
if (require.main === module) {
|
|
initializeDatabase();
|
|
}
|
|
|
|
module.exports = initializeDatabase; |