#How to paginate in API routes ?
15 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
How to paginate in API routes ?
you can use for example searchParams so enter a specific page or use a pagination token. Use that, what suite more your case. Then read the searchparams inside your route handler and return only a bunch of data for the specific page/pagination token
@sullen cloak solved?
I guess I'm still looking.
I guess there won't be a second answer :/
I actually use firestore, as far as I know it had such a feature.
normally a backend should have these kind of features yea...
But you need to build the stuff around it. And that's this part: #1253982030123761715 message
use startAfter and limit then
but searchParams/state is still needed to track displayed data
but in this case I would have built a proxy, that's why I use the api routes in the next js project to access both mobile and web
I thought firebase is your backend? And you backend should be somehow accessable. Normally though api endpoints. And these api endpoints exists from your provider (firebase)
I actually define api routes in next js and forward the data to firebase and I will write the exact same process for the mobile version, in short, I do not have a common backend api route