Files
evilspins/server/api/test/test-db-sync.post.ts
valere 0195c52d30
All checks were successful
Deploy App / build (push) Successful in 1m6s
Deploy App / deploy (push) Successful in 18s
test server NUXT_ env in nuxt config
2026-02-10 20:59:18 +01:00

22 lines
471 B
TypeScript

import { syncCardsWithDatabase } from '../../services/cardSync.service'
export default defineEventHandler(async (event) => {
const runtimeConfig = useRuntimeConfig()
const folderPath = runtimeConfig.NUXT_PATH_FILES
try {
const result = await syncCardsWithDatabase(folderPath)
return {
success: true,
...result
}
} catch (error: any) {
return {
success: false,
error: error.message,
stack: error.stack
}
}
})