添加Koyeb部署配置和文档

This commit is contained in:
patdelphi
2025-08-19 16:05:39 +08:00
parent 78f39e500b
commit 3e7120a339
9 changed files with 237 additions and 29 deletions

View File

@@ -5,7 +5,10 @@ const fs = require('fs');
class DatabaseManager {
constructor() {
this.db = null;
this.dbPath = path.join(__dirname, '../../numerology.db');
// 生产环境使用持久化存储路径,开发环境使用本地路径
this.dbPath = process.env.NODE_ENV === 'production'
? '/app/data/numerology.db'
: path.join(__dirname, '../../numerology.db');
this.schemaPath = path.join(__dirname, 'schema.sql');
}