Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What? You can still use an api with server components.


…have you used next?

https://nextjs.org/docs/app/building-your-application/data-f...

Spoiler: you don’t get an api.


From those same docs, it appears you can build an API with Route Handlers when using Server Components:

https://nextjs.org/docs/app/building-your-application/routin...


Correct. It can also run during the build, so it can be used to dynamically generated .txt, .json, or any other files. Great when deploying a static export of Next.js and dumping on S3 or similar.

https://nextjs.org/docs/app/building-your-application/deploy...


Do you know what an api is?




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: