Browse Source

FEAT: use native fetch 2

master
valere 5 months ago
parent
commit
82d091b28a
4 changed files with 3 additions and 7 deletions
  1. +3
    -1
      nuxt.config.ts
  2. +0
    -2
      server/api/details/[id].ts
  3. +0
    -2
      server/api/explore/[page].ts
  4. +0
    -2
      server/api/search/[termspage].ts

+ 3
- 1
nuxt.config.ts View File

@@ -27,6 +27,8 @@ export default defineNuxtConfig({
IMG_BASE_URL: 'https://media.themoviedb.org/t/p/w220_and_h330_face/', IMG_BASE_URL: 'https://media.themoviedb.org/t/p/w220_and_h330_face/',
} }
}, },

typescript: {
typeCheck: true
},
compatibilityDate: '2024-10-06', compatibilityDate: '2024-10-06',
}) })

+ 0
- 2
server/api/details/[id].ts View File

@@ -1,5 +1,3 @@
import fetch from 'node-fetch'

export default eventHandler(async (req) => { export default eventHandler(async (req) => {
const id = req.context.params?.id || '' const id = req.context.params?.id || ''
const url = `https://api.themoviedb.org/3/movie/${id}?language=fr-FR` const url = `https://api.themoviedb.org/3/movie/${id}?language=fr-FR`


+ 0
- 2
server/api/explore/[page].ts View File

@@ -1,5 +1,3 @@
import fetch from 'node-fetch'

export default eventHandler(async (req) => { export default eventHandler(async (req) => {
const page = req.context.params?.page || 1 const page = req.context.params?.page || 1
const url = `https://api.themoviedb.org/3/discover/movie?include_adult=false&include_video=false&language=en-US&page=${page}&sort_by=popularity.desc` const url = `https://api.themoviedb.org/3/discover/movie?include_adult=false&include_video=false&language=en-US&page=${page}&sort_by=popularity.desc`


+ 0
- 2
server/api/search/[termspage].ts View File

@@ -1,5 +1,3 @@
import fetch from 'node-fetch'

interface Film { interface Film {
title: string, title: string,
seed: number, seed: number,


Loading…
Cancel
Save