Introduction to API Routes in Next.js | NextJs Tutorial for Beginners #17

preview_player
Показать описание

python, C, C++, Java, JavaScript and Other Cheetsheets [++]:

►Learn in One Video[++]:

►Complete course [playlist]:

Follow Me On Social Media
Comment "#HarryBhai" if you read this 😉😉
Рекомендации по теме
Комментарии
Автор

In this next js course, we see a next level editing, salute to harry bhai 💥

ADITYA-qril
Автор

Bhai editing ke andar to kamaal kar diya aapne 🔥🔥🔥✨✨✨

khizrshaikh
Автор

after 2 -3 hours of research i realise
harry bhai using page router and i am using app router
i was trying to access api/hello.ts instead of api/route.js

litreally, it takes me lot of time to understand both app router and page router is differect functionality

GauravKushwaha-efww
Автор

Sadly bhaiya ki video ko 2-3 months lag jaate h lakhs mein views ke liye :( magar vo daily cool video laate h Thanks bhaiya :)👍

TrixArmy
Автор

aap k react k project se he mujhe as a mern stack developer job mili hai thankyou

arpan
Автор

Bhai mujhe apki video bohot acchi lagti h ese hi kro maza ata h dekhne me

weebpranav.
Автор

For pages/api/hello.js (Old Way)

// pages/api/hello.js

export default function handler(req, res) {
// Handle the incoming request and send a response
res.status(200).json({ message: 'Hello from the API!' });
}


But for Next.js 13+ with the app directory:
For app/api/hello/route.js (New Way):

// src/app/api/hello/route.js
import { NextResponse } from 'next/server';

export async function GET() {
return NextResponse.json({ message: 'Hello from the API!' });
}

NumanMuhammad-hypz
Автор

"Hurting someone's feelings is as easy as throwing a rock in a lake, but do you know how deep that rock can go?"

Arnav
Автор

Sir you are doing a good work thanks for providing this amazing knowledge free. Thanks a lot

RajuSharma-idvy
Автор

Bhai apke video pure Maharashtra mei Famous

travelingwithjivan
Автор

the next js 13.4 has some very new updates for api and req & res objects no longer works in app directory.

nikhilsharma
Автор

Harry Bhai aap bhi apna ek discord ka server bana do community grow krte dekh maza aega
peoples can learn by helping others too 😊

aakashjyoti
Автор

NextJs as a backend use karke mazaa aagaya

khizrshaikh
Автор

Harry Bhai please game development py koi course ly Aaye ☺️☺️

shortsburst
Автор

Whenever I see people commenting bad, the urge to purge becomes to surge

Arnav
Автор

Awesome!! your React MERN stack project is the motivation tha I am here to learn NEXT.js from you... I like the project based approach because at the end we have some good projects to mention in our resume...

zeenatfirdoshquadri
Автор

4:50
I think we can't see it on chrome console
But can in terminal
Because it is api

khizrshaikh
Автор

harry bhai thanks a lot. There is a message for newcommers.
If you study React course of code with harry then you will understand everything very quickly.

tehniatmirza
Автор

Harry bhai .. siebel crm ke baremai kuch tho idea do na... Kya isse future mai use keya jya sakhta hai .. and accha hai isme kaise master Kare ?? Please

jaganmokmod
Автор

json.stringify('data');

send with ajax (datatype=json)
localhost me work kar ra he but live server me php ko data nahi milraha he

badalbhai