Files
evilspins/server/api/sync-cards.post.ts
valere ffd5c5d7eb
All checks were successful
Deploy App / build (push) Successful in 49s
Deploy App / deploy (push) Successful in 22s
try fix .env with NUXT_ prefix
2026-02-10 18:44:00 +01:00

28 lines
576 B
TypeScript

import { syncCardsWithDatabase } from '../services/cardSync.service'
export default defineEventHandler(async (event) => {
const config = useRuntimeConfig()
const folderPath = process.env.NUXT_PATH_FILES
if (!folderPath) {
throw createError({
statusCode: 500,
message: 'NUXT_PATH_FILES not configured'
})
}
try {
const result = await syncCardsWithDatabase(folderPath)
return {
success: true,
...result
}
} catch (error: any) {
throw createError({
statusCode: 500,
message: error.message
})
}
})