test server NUXT_ env in nuxt config
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user