简体   繁体   English

如何在 next.js 框架中从后端 API 获取数据

[英]How to fetch data from backend API in next.js framework

I'm trying to create a table of records which takes data from backend springboot server and renders on UI using next.js framework of react.我正在尝试创建一个记录表,该表从后端 springboot 服务器获取数据并使用反应的 next.js 框架在 UI 上呈现。 Whats the best and most optimal way to achieve this实现这一目标的最佳和最佳方法是什么

now you can use fetch() on both client and server side code https://nextjs.org/docs/basic-features/supported-browsers-features#server-side-polyfills现在您可以在客户端和服务器端代码https://nextjs.org/docs/basic-features/supported-browsers-features#server-side-polyfills上使用fetch()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM