next.js - API Routes

為 next.js 練習紀錄。

引言

先練習二種基本的 Next.js 的 API Routes:Basic API Routes 與 Dynamic API Routes。

參考文章

程式碼紀錄

next.js 本身就支援 WebApi能力,routing 的組態也高度整合簡化。固定放在目錄api下面。詳紀說明不在此詳述。拜讀官方文件或模拜google大神皆能找到。

Basic API Routes 紀錄

後端

前端

Dynamic API Routes

後端

前端

Last updated