feat: enhance database environment handling and cleanup project
- Add environment-specific database selection (SQLite for local, MariaDB for NAS) - Remove edit button from admin detail view modal for cleaner UX - Clean up project files: remove redundant docs and test files - Update deployment script with improved SSH handling - Maintain backward compatibility while supporting both database types 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
18
server.js
18
server.js
@@ -6,12 +6,26 @@ const fs = require('fs');
|
||||
const bcrypt = require('bcrypt');
|
||||
const session = require('express-session');
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
const DatabaseHelper = require('./database/db-helper');
|
||||
// 환경에 따른 데이터베이스 헬퍼 선택
|
||||
const isNAS = process.env.NODE_ENV === 'production' || process.env.DEPLOY_ENV === 'nas';
|
||||
const isWindows = process.platform === 'win32' && !isNAS;
|
||||
|
||||
let DatabaseHelper;
|
||||
if (isNAS) {
|
||||
DatabaseHelper = require('./database/mariadb-helper');
|
||||
console.log('🗄️ NAS 환경: MariaDB 사용');
|
||||
} else if (isWindows) {
|
||||
DatabaseHelper = require('./database/db-helper');
|
||||
console.log('🗄️ 로컬 Windows 환경: SQLite 사용');
|
||||
} else {
|
||||
DatabaseHelper = require('./database/mariadb-helper');
|
||||
console.log('🗄️ Linux 환경: MariaDB 사용');
|
||||
}
|
||||
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 3005;
|
||||
|
||||
// 데이터베이스 헬퍼 인스턴스 (SQLite - 로컬 테스트용)
|
||||
// 데이터베이스 헬퍼 인스턴스
|
||||
const db = new DatabaseHelper();
|
||||
|
||||
// 미들웨어 설정
|
||||
|
Reference in New Issue
Block a user