install atropos (demo on /wait)
All checks were successful
Deploy App / deploy (push) Successful in 1m49s

This commit is contained in:
valere
2025-08-30 10:26:32 +02:00
parent d013e62fcf
commit 7a1cdf2178
55 changed files with 10731 additions and 11136 deletions

View File

@@ -1,23 +0,0 @@
import fs from 'fs'
import path from 'path'
export default eventHandler(async (event) => {
const id = event.context.params?.id || ''
const directoryPath = path.join(process.cwd(), 'media/files/music/' + id) // replace 'your-folder' with the folder you want to list
try {
// Read the directory contents
const files = await fs.promises.readdir(directoryPath)
return {
success: true,
files: files.filter(file => !file.startsWith('.')) // optional: exclude unwanted files
}
} catch (error) {
return {
success: false,
error: error.message
}
}
})

View File

@@ -1,21 +0,0 @@
import fs from 'fs'
import path from 'path'
export default eventHandler(async (event) => {
const directoryPath = path.join(process.cwd(), 'media/files/music')
try {
// Read the directory contents
const files = await fs.promises.readdir(directoryPath)
return {
success: true,
files: files.filter(file => !file.startsWith('.')).reverse() // exclude unwanted files
}
} catch (error) {
return {
success: false,
error: error.message
}
}
})