1. 修复 ignore
2. 推翻旧后端代码全部重写, 使用 SQLite
This commit is contained in:
CrescentLeaf
2025-08-01 22:53:05 +08:00
parent 0ecd6c6585
commit d0b5890b99
9 changed files with 283 additions and 1 deletions

17
src/config.ts Normal file
View File

@@ -0,0 +1,17 @@
import fs from 'node:fs/promises'
import chalk from 'chalk'
let config = {
data_path: "./thewhitesilk_data"
}
try {
config = JSON.parse(await fs.readFile('thewhitesilk_config.json'))
} catch (_e) {
console.log(chalk.yellow("配置文件貌似不存在, 正在创建..."))
await fs.writeFile('thewhitesilk_config.json', JSON.stringify(config))
}
await fs.mkdir(config.data_path, { recursive: true })
export default config