test server NUXT_ env in nuxt config
All checks were successful
Deploy App / build (push) Successful in 1m6s
Deploy App / deploy (push) Successful in 18s

This commit is contained in:
valere
2026-02-10 20:59:18 +01:00
parent d89f2aa3e7
commit 0195c52d30
10 changed files with 21 additions and 17 deletions

View File

@@ -6,11 +6,7 @@ let _db: ReturnType<typeof drizzle> | null = null
export function useDB() {
if (_db) return _db
let dbPath = process.env.NUXT_PATH_DB
if (!dbPath) {
throw new Error('PATH_DB is not configured')
}
let dbPath = 'data/music.db'
// Convertir le chemin en URL file:// si ce n'est pas déjà une URL
if (!dbPath.startsWith('file:') && !dbPath.startsWith('libsql:') && !dbPath.startsWith('http')) {