How to use SSG with API Route #2747
-
Hello! 🥲 I connected the database and configured the API Route, it looks like this: /pages/api/sponsors.ts
Now I need to show data Like this:
I found this method: https://nextra.site/docs/guide/ssg, but this code is not work when I change fetch url to my local API Route (http://localhost:3000/pages/api/sponsors). Next, I found this method: https://nextjs.org/docs/pages/building-your-application/data-fetching/client-side I was try this method too: https://nextjs.org/docs/pages/building-your-application/data-fetching/get-static-props#using-getstaticprops-to-fetch-data-from-a-cms I'm created in Please, help me how I can do it :( |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Can you provide a link to your repo or give some code snippets to show what you have tried that didn't work? |
Beta Was this translation helpful? Give feedback.
Oh, I didn't catch the array.
It should be