NextJS 14 - How to FETCH DATA, SERVER API Routes

preview_player
Показать описание
This Next JS 14 Tutorial will show you how to fetch data from an external website, or how to fetch data from your own server. To fetch data from the server, I will create a Server API to post JSON data.

Video Time Markers
00:00 - Fetching Data
03:32 - Server API
06:20 - Pass Params to Server API
10:56 - Dynamic Server API
13:46 - POST data to Server API

To download the full code in this video, visit my Patreon.

Social Links
Рекомендации по теме
Комментарии
Автор

thank you very much! it was straightforward which is easy to understand. thank you.

User-wpsh
Автор

I really like the straightforward nature of this tutorial. Way to stay on task and show how to do the thing concisely.

BrendonGruis
Автор

some people used to set GET(req, res), if you use "res" in it you CAN NOT use {params} too, you'll probably get and error!(params is undefined)

محمدحسینمسلمی-حذ
Автор

Needed this just now. Thanks mate 😊.

Woyld love for you to do a tutorial where you show getting data and allowing them be in different pages. For example. If i had a side bar with profile and dashboard. How to make the data pass to the 2 pages without having to necessarily call the API again so that its very fast navigating.

legadax
Автор

wonderful tutorial ... plzz continue this.

coursereviewer
Автор

But doesn't it mean that the slugs are open and accessible to anyone?

ashwinmanghat
Автор

bro can you make a todo app with next js with external api fetch, typescript would be more related if you can.

blabla-kkbl
Автор

Hey, what is the difference between router handlers and api routes, and which one can i use in a next js 14 app?

AndresMartinez-sezl
Автор

lol, now main issue is how to get data from db in js file :)) u used static json array

farzad
Автор

Fetching to an outside url, in your example dummy.json/products didnt work for me :(

irule
Автор

Idk why they don’t update the docs. But great tutorial

unrullEE
Автор

some people used to set GET(req, res), if you use "res" in it you CAN NOT use {params} too, you'll probably get and error!(params is undefined)

محمدحسینمسلمی-حذ