feat: implement core Nuxt application with film browsing, search, and detail page functionality using OPhim and NguonC APIs.

This commit is contained in:
thanhvudaynee
2026-05-17 20:30:19 +07:00
parent 90791df93d
commit 34d25df560
18 changed files with 2907 additions and 145 deletions
+28
View File
@@ -0,0 +1,28 @@
import { getNguoncDetail, getOphimDetail } from '../../utils/movies'
export default defineEventHandler(async (event) => {
const slug = getRouterParam(event, 'slug')
const source = getQuery(event).source
if (!slug) {
throw createError({ statusCode: 400, statusMessage: 'Thiếu slug phim' })
}
if (source === 'nguonc') {
try {
return await getNguoncDetail(slug)
} catch {
return await getOphimDetail(slug)
}
}
try {
return await getOphimDetail(slug)
} catch (error) {
try {
return await getNguoncDetail(slug)
} catch {
throw error
}
}
})