Data fetching
Unanswered
Abyssinian posted this in #help-forum
AbyssinianOP
Hi there,
I'm making an application to watch new movie trailers. I am using a Supabase database where I have stored all the trailers for different movies. And I have the path /watch/movie/[id] ready. But now I don't know how to fetch the data from the database. I was thinking of adding /api/movie/[id] to the API routes, where the supabase client would run and fetch all the data using the ID parameter form URL. Or is it more efficient to always fetch the data directly in [id].js when the page is visited and cache it, for example?
I'm making an application to watch new movie trailers. I am using a Supabase database where I have stored all the trailers for different movies. And I have the path /watch/movie/[id] ready. But now I don't know how to fetch the data from the database. I was thinking of adding /api/movie/[id] to the API routes, where the supabase client would run and fetch all the data using the ID parameter form URL. Or is it more efficient to always fetch the data directly in [id].js when the page is visited and cache it, for example?
1 Reply
AbyssinianOP
bump