Files
score-backend/db/index.ts

17 lines
433 B
TypeScript

/*
* @Date: 2025-06-12 16:48:44
* @LastEditors: 陈子健
* @LastEditTime: 2025-06-13 14:23:03
* @FilePath: /my-score/honoback/db/index.ts
*/
import { DatabaseSync } from "node:sqlite"
import { join, dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = dirname(fileURLToPath(import.meta.url))
// 初始化数据库连接
const db = new DatabaseSync(join(__dirname, 'media.db'))
export { db }